Skip to content

Instantly share code, notes, and snippets.

@tinaroh
tinaroh / keybase.md
Created July 24, 2019 01:07
Keybase Proof

Keybase proof

I hereby claim:

  • I am tinaroh on github.
  • I am troh (https://keybase.io/troh) on keybase.
  • I have a public key ASAnetLs-uQAUA9N3XSbWsuRixG1dczDmNjFSMez6pa6zwo

To claim this, I am signing this object:

@tinaroh
tinaroh / merge_contact_list.py
Created October 13, 2018 05:47
Merge one SendGrid Contact List into another
# SendGrid Web UI does not allow merging of recipients from one Contact List into another.
#
# If you manually export the CSV and then try to re-import, it won't import fields "last_opened", "last_clicked", "last_emailed"
# since they are reserved fields.
#
# References:
# https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html#List-Recipients-on-a-List-GET
# https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html#Add-Multiple-Recipients-to-a-List-POST
import requests
@tinaroh
tinaroh / delete_stales.sh
Last active August 27, 2016 11:08
Delete merged remote Git branches before a specific YYYY-MM-DD date. (Mac OSX BSD)
#!/bin/bash
if [[ $# -eq 1 && $(date -f "%Y-%m-%d" -j "$1") ]]; then
before_date="$1"
regex="^([0-9-]+)[[:space:]]([0-9:]+)[[:space:]]([+0-9-]+)[[:space:]](origin/)(.+)$"
for branch in $(git branch -r --merged | grep -v HEAD); do
line="$(git show --format="%ci" $branch | head -n 1) $branch"
if [[ $line =~ $regex ]]; then
branch_date="${BASH_REMATCH[1]}"
branch_name="${BASH_REMATCH[5]}"
@tinaroh
tinaroh / gpob.zsh
Last active July 28, 2016 22:19
git push origin BRANCH-NAME
gpob() {
git push origin $(git rev-parse --abbrev-ref HEAD) $1
}