This file contains hidden or 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
// \p{L} for any text character | |
// \d for any digit | |
// /u for unicode | |
const replaced = url.replace(/[^\p{L}\d]/gimu, '') |
This file contains hidden or 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 uniqueBy = (items: any[]) => (key: string) => | |
[...new Map(items.map(item => [item[key], item])).values()] | |
// OR | |
const unique = [...new Map(items.map(item => [item[key], item])).values()]; |
This file contains hidden or 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
{ | |
"snippet-rf": { | |
"prefix": "rf", | |
"body": [ | |
"import React from 'react';", | |
"import s from './${TM_FILENAME_BASE}.module.css'", | |
"", | |
"", | |
"interface ${TM_FILENAME_BASE}Props {", | |
" // TODO", |
This file contains hidden or 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 'truncate -s 0 $(docker system info | grep "Docker Root Dir" | cut -d ":" -f2 | cut -d " " -f2-)/containers/*/*-json.log'; |
This file contains hidden or 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 extractDomainName = (url:string) => { | |
const [extension, domain] = new URL(url).hostname.split('.').reverse(); | |
return `${domain}.${extension}`; | |
} | |
This file contains hidden or 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
#!/bin/bash | |
git filter-branch --tree-filter "find . -name 'ops/roles/ota/files/.env' -exec sed -i -e \ | |
's/<thepasswordtoremove>/***REMOVED***/g' {} \;" | |
git reflog expire --expire=now --all && git gc --prune=now --aggressive | |
git push --force --all | |
# If this commit was hosted on github, you will still be able to access the failing commit on the web | |
# which is not what you want | |
# This is because GitHub needs to run garbage collection and this will be done manually upon request |
This file contains hidden or 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
“Great people are those who make others feel that they, too, can become great.” | |
— Mark Twain | |
“Action is the universal language of success.” | |
— Dr. Steve Maraboli |
This file contains hidden or 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
name: optimal-post-on-twitter | |
on: | |
schedule: | |
- cron: '58 17 * * MON' # time adapted for NY timezone | |
- cron: '49 17 * * MON' | |
- cron: '32 13 * * TUE' | |
- cron: '58 17 * * TUE' | |
- cron: '49 21 * * TUE' | |
- cron: '32 13 * * WED' |
This file contains hidden or 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
[alias] | |
# shortcuts | |
c = commit | |
co = checkout | |
cp = cherry-pick | |
f = fetch | |
# enhancements | |
d = diff -- ':!package-lock.json' ':!yarn.lock' # Do not show lock files when diffing | |
ds = diff --staged -- ':!package-lock.json' ':!yarn.lock' # Do not show lock files when diffing staged files |