Skip to content

Instantly share code, notes, and snippets.

View justsml's full-sized avatar
🔥
#BLM

Dan Levy justsml

🔥
#BLM
View GitHub Profile
@fraune
fraune / touch_id_sudo.sh
Last active December 27, 2023 05:49
Enable a Macbook's Touch ID to authorize the `sudo` command in MacOS Terminal
sudo grep -q -F 'auth sufficient pam_tid.so' /etc/pam.d/sudo || sudo sed -i '' '2i\
auth sufficient pam_tid.so
' /etc/pam.d/sudo
/**
* `filteredFlagFactory` supports 3 states of a feature flag:
* - True,
* - False,
* - and restricted by ID(s).
*
*/
export function filteredFlagFactory(
flagValue: string,
defaultIdField = 'userId'
@justsml
justsml / RectangleConfig.json
Last active May 19, 2022 21:05
Rectangle: customized config for ⭐️ Mac window layout utility.
{
"bundleId" : "com.knollsoft.Rectangle",
"defaults" : {
"allowAnyShortcut" : {
"bool" : false
},
"almostMaximizeHeight" : {
"float" : 0
},
"almostMaximizeWidth" : {
@shqld
shqld / cargo_x86_64-unknown-linux-gnu-on-m1-mac.sh
Created March 15, 2022 14:19
cargo build for the target x86_64-unknown-linux-gnu on M1 Mac
# https://github.com/messense/homebrew-macos-cross-toolchains
brew tap messense/macos-cross-toolchains
brew install x86_64-unknown-linux-gnu
export CC_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-gcc
export CXX_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-g++
export AR_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-ar
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-unknown-linux-gnu-gcc
@justsml
justsml / macos-setup.md
Last active January 7, 2024 14:06
MacOS setup

MacOS - Software Developer Environment Setup

Dan's collection of MacOS setup and configuration scripts, updated for 2022 🚀!

Table of Contents

Software & Apps

Iterables, AsyncIterables, Observables, Oh My!

I know there is a lot of confusion around Observables, Iterables, AsyncIterables and AsyncObservables. Let's try to break this down and the reasons for each.

Pull versus Push Collections

When it comes to collections, you have two ways of thinking about collections, push versus pull. With pull, the consumer is in control of when you get the items, but with push, you get the values when the producer is ready.

Pull Based Collections

const combiningMarks = /([\0-\u02FF\u0370-\u1AAF\u1B00-\u1DBF\u1E00-\u20CF\u2100-\uD7FF\uE000-\uFE1F\uFE30-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])([\u0300-\u036F\u1AB0-\u1AFF\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]+)/gmi;
/**
Remove unicode combining symbols.
Will convert the following string: Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞
Into: ZALGǪ!
*/
export const removeCombiningMarks = (input) => {
return input.replace(combiningMarks, (substr, ...args) => {
@brudnak
brudnak / nyan-cat.gif
Last active February 4, 2020 18:39
nyan-cat.gif
nyan-cat.gif
@brudnak
brudnak / bongo-cat.gif
Last active March 21, 2023 23:26
bongo-cat.gif
bongo-cat.gif
@justsml
justsml / the-dumpster-fire-of-project-configuration-noise.md
Last active February 1, 2020 07:00
PSA: Modern project configuration files needlessly pollute root folders by default!