Dan's collection of MacOS setup and configuration scripts, updated for 2022 🚀!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ReSocket { | |
private token: string | undefined; | |
private socket: WebSocket | undefined; | |
private listeners: boolean = false; | |
private currentAttempt: number = 0; | |
private backoffTime: number = 1000; | |
private maxAttempts: number = 30; | |
private timer: NodeJS.Timeout | undefined; | |
private messageFn: (data: any) => void = (data) => { | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo sh -c 'echo "auth sufficient pam_tid.so" > /etc/pam.d/sudo_local' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* `filteredFlagFactory` supports 3 states of a feature flag: | |
* - True, | |
* - False, | |
* - and restricted by ID(s). | |
* | |
*/ | |
export function filteredFlagFactory( | |
flagValue: string, | |
defaultIdField = 'userId' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bundleId" : "com.knollsoft.Rectangle", | |
"defaults" : { | |
"allowAnyShortcut" : { | |
"bool" : false | |
}, | |
"almostMaximizeHeight" : { | |
"float" : 0 | |
}, | |
"almostMaximizeWidth" : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) => { |


NewerOlder