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
''' | |
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. |
Prioritize Homebrew's python3 over default MacOS python2:
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
Install python3 with Homebrew:
brew install python
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 |
# brew install jsmin | |
cat file-with-comments.jsonc | jsmin | jq 'keys' |
# 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 |
# 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' |