Skip to content

Instantly share code, notes, and snippets.

@mhuebert
mhuebert / _.md
Last active April 24, 2024 09:41
shadow-cljs build hook for purgecss

purgecss is a tool for removing unused css classes from source files. It's particularly useful for functional css frameworks like tachyons, where it's normal to only use a tiny fraction of available classes. This gist contains example code you could use to add purgecss to a shadow-cljs build.

  • make sure to yarn add purgecss first
  • usage is (hooks/purge-css {:css-source __ :js-globs __ :out-dir __})
    • :css-source is the path to the original, bloated CSS file (from project root). This is ideally in a source directory, or node_modules as in this example. This cannot be the public path where the css is ultimately read.
  • :js-globs is a string / vector of strings, indicating which files to read as input. These should be all of your compiled javascript bundles which contain your views. purgecss does a brute-force parse of all these files, extracting all the strings to figure out which clas
@Joao-Peterson
Joao-Peterson / gmk67-manual.md
Last active April 24, 2024 09:40
GMK67 manual (English)
@fabiolimace
fabiolimace / ksuid.sql
Last active April 24, 2024 09:40
Functions for generating Segment's KSUIDs on PostgreSQL
/*
* MIT License
*
* Copyright (c) 2023 Fabio Lima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@AgentOak
AgentOak / youtube_formats.md
Last active April 24, 2024 09:38
Youtube Format IDs

Last updated: April 2021

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video

Resolution AV1 HFR High AV1 HFR AV1 VP9.2 HDR HFR VP9 HFR VP9 H.264 HFR H.264
MP4 MP4 MP4 WebM WebM WebM MP4 MP4
#!/bin/bash
# Source https://stackoverflow.com/questions/36651091/how-to-install-packages-in-linux-centos-without-root-user-with-automatic-depen
pkgname=$1
if [ -z $pkgname ]; then
echo "Usage: ./non-root-yum-install.sh pkgname-here"
exit 1
fi
rand=$(openssl rand -base64 6)
@inchoate
inchoate / readme.md
Last active April 24, 2024 09:37
Open clicked URLs into a particular Google Chrome profile

Problem

When I click on links from Slack or Outlook on MacOS they open in seemingly random browser windows/profiles. This is annoying.

Solution

Open links in a particular google chrome profile window. Be less annoyed.

  1. In Chrome, visit chrome://version and find the desired profile name. Mine was Default. Copy that profile's directory name, like Profile 2 or Default, not the profile's vanity name you see when you click on your profile icon in the browser.
  2. Install Finicky: brew install finicky. After install it should be running and you should see the icon in the upper toolbar.
  3. From the Finicky Toolbar Item, click > Config > Create New
  4. Edit the new file ~/.finicky and make it look something like this, filling in your profile name:
Dogfooding
  • Dogfooding is using an app or feature shortly before it's publically released.
  • The term dogfood comes from the expression "eating your own dogfood".
Fishfooding
  • Fishfooding is using an app or feature really early in its development before it's even really finished.
  • The term "fishfood" actually comes from the Google+ team inside of Google.
  • Google+ was internally codenamed Emerald Sea.
@drole
drole / TycoonIOCs.md
Last active April 24, 2024 09:34
Tycoon IOCs

Tycoon Phishing Kit Landing Pages (8-Feb-2024):

  • https[:]//djcs.ybuu.ru/8PB830a3IXi78o9/
  • https[:]//26qw8.hicx0.com/72w0/
  • https[:]//5f460.dkx01.com/373i/
  • https[:]//1826x.eauth0.com/499p/
  • https[:]//discovery.expedownhe.com/fg7n232/
  • https[:]//874pf.eaver1.com/h538/
  • https[:]//s8k47.moraspu.ru/02b3/
  • https[:]//melody.lincelryou.com/y48633m/
  • https[:]//721cj.ckasmi1.com/h319/
@lopes
lopes / winproxy.py
Created January 3, 2019 15:16
Sets Windows' proxy configurations easily.
'''Sets Windows' proxy configurations easily.
This script allows user to update Windows proxy settings easily,
by using predefined values assigned to proxies identified by
keywords.
Note that it'll also refresh your system to guarantee that all
settings take effect. Although in the tests it seemed unnecessary
(Windows 8.1), it's considered just a guarantee.
@daveh
daveh / checkout.php
Last active April 24, 2024 09:33
Simple PHP Stripe Checkout (code to accompany https://youtu.be/1KxD8J8CAFg)
<?php
require __DIR__ . "/vendor/autoload.php";
$stripe_secret_key = "your Stripe secret key here";
\Stripe\Stripe::setApiKey($stripe_secret_key);
$checkout_session = \Stripe\Checkout\Session::create([
"mode" => "payment",