layout | author | title | revision | version | description |
---|---|---|---|---|---|
default |
mattmc3 |
Modern SQL Style Guide |
2019-01-17 |
1.0.1 |
A guide to writing clean, clear, and consistent SQL. |
View modern_sql_style_guide.md
View cloudbuild.yaml
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
# Connect to GCP Cloud Build docker (or docker compose) container from outside of docker from the subsequent step | |
# | |
# (For some reason, the below code requires "dockerize - wait" to work) | |
steps: | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ['run', '--name', 'ping_svc', '--network', 'cloudbuild', '-d', 'jonmorehouse/ping-pong'] | |
- name: 'jwilder/dockerize:0.6.1' | |
args: ['dockerize', '-timeout=60s', '-wait=http://ping_svc:8080'] | |
- name: 'gcr.io/cloud-builders/curl' |
View git-extract-dir-notes.sh
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
# using: | |
# - git filter-branch OR | |
# - git filter-repo | |
# extract folder into a new repo | |
git clone git@github.com:__ORG__/__PROJECT__.git __LOCAL_ALIAS_DIR__ | |
cd __LOCAL_ALIAS_DIR__ | |
git co -b main |
View gist:60203538829f52f43834940c19f492f4
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
# brew install jsmin | |
cat file-with-comments.jsonc | jsmin | jq 'keys' |
View kill-8080
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
PROCESS_PHRASE="*:8080 (LISTEN)" | |
PROCESS_LINE=`lsof -Pn | grep "$PROCESS_PHRASE"` | |
if [[ -n $PROCESS_LINE ]]; then | |
PROCESS_ID=`awk '{print $2}' <<< $PROCESS_LINE` | |
echo "Killing process id=$PROCESS_ID ('$PROCESS_LINE')" | |
else | |
echo "No matching process found for '$PROCESS_PHRASE'" | |
fi |
View py-on-mac.md
Prioritize Homebrew's python3 over default MacOS python2:
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
Install python3 with Homebrew:
brew install python
View server-cors.py
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
''' | |
Based on https://gist.github.com/enjalot/2904124 (in Python 2) -> quick-migrated to Python 3 | |
Usage: python server-cors | |
''' | |
import http.server as httpserver | |
class CORSHTTPRequestHandler(httpserver.SimpleHTTPRequestHandler): | |
def send_head(self): | |
"""Common code for GET and HEAD commands. |
View macos-random.md
dyld: Library not loaded
Problem
When running tig
$ tig
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
Referenced from: /usr/local/bin/tig
Reason: image not found
View gist:d6a6726b1cbea64574746366290506ce
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
echo '{"yo":"boo", "so":"no"}' | python -m json.tool | |
{ | |
"so": "no", | |
"yo": "boo" | |
} |
View load-resource.scala
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
def loadResource(filename: String) = { | |
val source = scala.io.Source.fromURL(getClass.getResource(filename)) | |
try source.mkString finally source.close() | |
} |
NewerOlder