Skip to content

Instantly share code, notes, and snippets.

View mythmon's full-sized avatar

Michael Cooper mythmon

View GitHub Profile
@mythmon
mythmon / githelper.py
Created November 18, 2013 22:14
A helper to make calling git with subprocess nicer in python.
def to_cli_args(*args, **kwargs):
cmd = []
for k, v in kwargs.items():
short = len(k) == 1
if short:
cmd.append('-' + k)
if v is not True:
cmd.append(v)
else:
if v is True:
@mythmon
mythmon / james.py
Last active December 20, 2015 23:58
james.py is a way of calling Chief from the command line.
#!/usr/bin/env python
"""
james.py - Chief CLI.
USAGE: james.py ENV REF
ENV - Environment defined in the config file to deploy to.
REF - A git reference (like a SHA) to deploy.
Config: james.ini in the current directory should be an ini file with
one section per environment. Each environment should have a
@mythmon
mythmon / blocks.md
Last active December 16, 2015 22:29
So I have this idea. I want to make a programming language. I have some goals. Lets see how this works out.

Blocks

Blocks are kind of like functions. The store a sequence of expressions to be evaluated later. They are a value, so like any value they need to be bound to a name to be stored.

let first = {
    print 'Hello, world!'

}

@jsocol
jsocol / pimport
Created June 8, 2010 17:11
pvimport - load a gzipped sql dump through pv
#!/bin/sh
# Import a (g|b)zipped SQL dump into a specified database through pipeviewer.
if [ $# -lt 2 ]; then
echo "USAGE: $0 <filename> <database>"
exit 1
fi
EXT=${1/*./}