Skip to content

Instantly share code, notes, and snippets.

George Song gsong

Block or report user

Report or block gsong

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gsong /
Created Jan 14, 2018
Parse NYT where to go list
#!/usr/bin/env python
import csv
import json
import re
from collections import OrderedDict
from urllib.parse import quote
import attr
import click
gsong /
Last active Sep 11, 2018
Pyenv Setup Step-by-step
  1. Install [pyenv][] using [pyenv-installer][]:

    curl -L | bash
  2. Activate pyenv for Terminal:

    echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
gsong / brew-config.log
Last active May 7, 2017
`brew install highlight` error
View brew-config.log
HOMEBREW_VERSION: 1.2.0-50-g3e4547f5
HEAD: 3e4547f52e7ebec633f8bfefc8a396d944edf908
Last commit: 52 minutes ago
Core tap ORIGIN:
Core tap HEAD: 9c4f788f512c3fdb9f83dace59b2194a778c13bd
Core tap last commit: 12 hours ago
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
gsong / gifting
Last active Dec 11, 2016
Christmas gift exchange
View gifting
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from random import sample
# people grouped together cannot gift to each other
people = [
('Sue', 'Sam'),
('Heather', 'Matt'),
('Noelle', 'George'),
gsong /
Last active Aug 29, 2015
Test to validate python-epo-ops-client
import platform
import epo_ops
registered_client = epo_ops.RegisteredClient(
gsong /
Last active Dec 26, 2015
Python script to return the last successful Time Machine backup timestamp.
#!/usr/bin/env python
from datetime import timedelta, tzinfo
from shlex import split
from subprocess import Popen, PIPE
import os
import plistlib
ZERO = timedelta(0)
NOT_ENABLED = u'Not enabled.'
# Source:
# All-purpose gist tool for Pythonista.
# When run directly, this script sets up four other scripts that call various
# functions within this file. Each of these sub-scripts are meant for use as
# action menu items. They are:
# Set Gist - Set the gist id that the current file should be
# associated with.
gsong /
Last active Dec 21, 2015
Pythonista demo of a single worker thread which polls a website for updates and displays the result in `Scene.draw`.
from datetime import datetime
import Queue
import re
import threading
import urllib2
from scene import *
Number of threads: {}
gsong / gist:6321633
Last active Jun 14, 2019
Bash script to generate SSL csr/key/crt
View gist:6321633
# Usage:
# ssl_setup [--self] <name> <csr_config>
# This script is used to generate key and CSR for use HTTPS in Nginx.
# --self Generate self-signed certificate in addition to key and CSR.
# name Output files will be named as <name>.key and <name>.csr.
gsong / net.damacy.releasemem.plist
Created Mar 17, 2012
LaunchAgent to release inactive memory on OS X 10.7
View net.damacy.releasemem.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
You can’t perform that action at this time.