Skip to content

Instantly share code, notes, and snippets.

View mdzhang's full-sized avatar
🇵🇸
decolonizepalestine.com

meesh mdzhang

🇵🇸
decolonizepalestine.com
View GitHub Profile
@mdzhang
mdzhang / deleteold.sh
Created January 24, 2024 21:22
delete old git branches
#!/bin/bash
git fetch --prune
for k in $(git branch -r --sort=committerdate | head -n 100); do
if [ -z "$(git log -1 --after='2 years ago' -s $k)" ]; then
br=$(echo $k | cut -d'/' -f2-)
echo "Removing $br"
echo "--"
@mdzhang
mdzhang / deploy.sh
Created August 7, 2023 18:25
Deploy a ZAF app in CI
#!/bin/bash
set -o errexit
set -e
COLOR='\033[1;36m'
RED='\033[0;31m'
NC='\033[0m' # No Color
die()
@mdzhang
mdzhang / uke-key.txt
Last active November 8, 2021 20:11
ukelele key card
Major Key
I II III IV V VI VII
A A Bm C#m D E F#m G#dim
B B C#m D#m E F# G#m A#dim
C C Dm Em F G Am Bdim
D D Em F#m G A Bm C#dim
E E F#m G#m A B C#m D#dim
F F Gm Am A# C Dm Edim
G G Am Bm C D Em F#dim
@mdzhang
mdzhang / keybase.md
Last active February 20, 2021 18:29

Keybase proof

I hereby claim:

  • I am mdzhang on github.
  • I am mdzhang (https://keybase.io/mdzhang) on keybase.
  • I have a public key whose fingerprint is 1392 FAAD 8AFC 2222 AD84 195E 1650 A224 DE3E 63DB

To claim this, I am signing this object:

@mdzhang
mdzhang / release
Created December 4, 2020 06:59
Release
#!/bin/bash
set -ex
command -v gh >/dev/null 2>&1 || die "gh is required but not installed. Aborting. See https://github.com/cli/cli"
usage()
{
echo " Usage: ${0}
@mdzhang
mdzhang / nomad.py
Created October 12, 2019 19:24
Scrape NomadList for data and dump to CSV
"""Scrape data from NomadList into local CSV.
Usage:
python scrape.py --cities Austin 'Chiang Mai' Taipei Auckland Ubud 'Buenos Aires' 'Mexico City'
"""
import argparse
import logging
import os
import re
import string
@mdzhang
mdzhang / goodreads.py
Last active August 30, 2019 04:17
Script to filter down goodreads listopia items and order them based on what I'm mostly likely to want to read
"""Filter down a Goodreads Listopia list to books I'm most likely to like.
Fetches the raw HTML with Selenium (requires chromedriver), extracts book data
to a pandas data frame using BeautifulSoup, does some massaging, then prints
it out nicely.
TODO:
- more data points (year, contents of top upvoted reviews, shelves,
page count, read status, etc.)
- support multi-page Listopia lists
@mdzhang
mdzhang / python.vim
Last active December 8, 2021 05:39
Vim - SQL highlighting in Python strings
" Put this in ~/.vim/after/syntax/python.vim
" Slight tweaks to https://lonelycoding.com/can-i-use-both-python-and-sql-syntax-highlighting-in-the-same-file-in-vim/
" Needed to make syntax/sql.vim do something
unlet b:current_syntax
" Load SQL syntax
syntax include @SQL syntax/sql.vim

Keybase proof

I hereby claim:

  • I am mdzhang on github.
  • I am mdzhang (https://keybase.io/mdzhang) on keybase.
  • I have a public key ASBcz-kSfFWfyIqFcW9qGjl_D9Bm5qcRRLF_ITQkE4YxNQo

To claim this, I am signing this object:

[
{
"kana": "ア",
"roumaji": "a",
"type": "gojuuon"
},
{
"kana": "イ",
"roumaji": "i",
"type": "gojuuon"