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
| buf, bodyErr := ioutil.ReadAll(r.Body) | |
| if bodyErr != nil { | |
| log.Print("bodyErr ", bodyErr.Error()) | |
| http.Error(w, bodyErr.Error(), http.StatusInternalServerError) | |
| return | |
| } | |
| rdr1 := ioutil.NopCloser(bytes.NewBuffer(buf)) | |
| rdr2 := ioutil.NopCloser(bytes.NewBuffer(buf)) | |
| log.Printf("BODY: %q", rdr1) |
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
| func openbrowser(url string) { | |
| var err error | |
| switch runtime.GOOS { | |
| case "linux": | |
| err = exec.Command("xdg-open", url).Start() | |
| case "windows": | |
| err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start() | |
| case "darwin": | |
| err = exec.Command("open", url).Start() |
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
| [merge] | |
| keepBackup = false | |
| tool = p4merge | |
| [mergetool "p4merge"] | |
| cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\"" | |
| keepTemporaries = false | |
| trustExitCode = false | |
| keepBackup = false | |
| [diff] | |
| tool = p4merge |
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 | |
| JQCLI=jq | |
| command -v ${JQCLI} >/dev/null 2>&1 || { echo >&2 "I require jq but it's not installed. Please run 'brew install jq'."; exit 1; } | |
| yarn add -D tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9 | |
| yarn add @craco/craco | |
| echo "$(${JQCLI} '.scripts.start = "craco start" | .scripts.build = "craco build" | .scripts.test = "craco test"' package.json)" > package.json | |
| cat <<EOF > craco.config.js |
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
| JSON +50.6k/ -86.9k βββββββββββββββββββββ 29.3% | |
| HTML +3.4k/ -0 βββββββββββββββββββββ 16.4% | |
| Python +4.2k/ -0 βββββββββββββββββββββ 15.6% | |
| SVG +351/ -0 βββββββββββββββββββββ 13.8% | |
| JavaScript +2.9k/ -443 βββββββββββββββββββββ 11.6% | |
| TypeScript +1.4k/ -257 βββββββββββββββββββββ 6.5% | |
| Markdown +805/ -4 βββββββββββββββββββββ 2.3% | |
| reStructuβ¦ +606/ -0 βββββββββββββββββββββ 1.7% | |
| CSS +371/ -2 βββββββββββββββββββββ 0.8% | |
| Text +184/ -0 βββββββββββββββββββββ 0.7% |
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
| π Morning 35 commits βββββββββββββββββββββ 5.3% | |
| π Daytime 164 commits βββββββββββββββββββββ 24.6% | |
| π Evening 404 commits βββββββββββββββββββββ 60.7% | |
| π Night 63 commits βββββββββββββββββββββ 9.5% |
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 | |
| # print rotating bar animation in 10 seconds | |
| while true; do | |
| for s in / - \\ \|; do | |
| printf "\r$s"; | |
| sleep 1; | |
| done; | |
| done & |
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
| import sys | |
| from logbook import Logger, StreamHandler | |
| stream_handler = StreamHandler(sys.stdout) | |
| def main(): | |
| log = Logger("My Awesome Logger") | |
| log.warn("This is too cool for stdlib") |
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
| ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
| # Don't add passphrase | |
| openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
| cat jwtRS256.key | |
| cat jwtRS256.key.pub |
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
| # Backup files | |
| #https://explainshell.com/explain?cmd=rsync+-azuv+--delete+--progress+--exclude+%27node_modules%27 | |
| rsync -auvhp --delete --exclude=node_modules [source] [destination] | |
| # Remove all node_modules folders | |
| # https://explainshell.com/explain?cmd=find+.+-name+%22node_modules%22+-type+d+-prune+-exec+rm+-rf+%27%7B%7D%27+%2B | |
| find . -name "node_modules" -type d -prune -exec rm -rf '{}' + |
NewerOlder