Skip to content

Instantly share code, notes, and snippets.

View zeekay's full-sized avatar
💎
👋

z zeekay

💎
👋
View GitHub Profile
@zeekay
zeekay / upstart.conf
Created June 30, 2014 15:38
Virtualenv + Upstart
description "Virtualenv-based python service"
author "Zach Kelling <[email protected]>"
start on startup
respawn limit 10 90
script
chdir /var/apps/service
. bin/activate
### Keybase proof
I hereby claim:
* I am zeekay on github.
* I am zeekay (https://keybase.io/zeekay) on keybase.
* I have a public key whose fingerprint is 634D 585F 1B50 FCB2 288E A77C 9544 6586 5C50 FE9C
To claim this, I am signing this object:
@zeekay
zeekay / lock.js
Last active August 29, 2015 14:04
// Lock async function until complete.
function lock(fn) {
return function() {
var args = Array.prototype.slice.call(arguments, 0);
var cb = args.pop() || function(){};
var that = this;
if (fn.locked)
return cb(new Error('locked!'))
@zeekay
zeekay / mtime_file_watcher.py
Last active January 8, 2022 20:59
Replacement MtimeFileWatcher for App Engine SDK's dev_appserver.py
#!/usr/bin/env python
#
# Replacement `MtimeFileWatcher` for App Engine SDK's dev_appserver.py,
# designed for OS X. Improves upon existing file watcher (under OS X) in
# numerous ways:
#
# - Uses FSEvents API to watch for changes instead of polling. This saves a
# dramatic amount of CPU, especially in projects with several modules.
# - Tries to be smarter about which modules reload when files change, only
# modified module should reload.
@zeekay
zeekay / minls.py
Created December 12, 2014 21:14
Compress ableton live projects using Flac.
#!/usr/bin/env python2
#
# minls
#
# Compress Ableton Live sets using Flac compression.
import argparse
import gzip
import os.path
import subprocess
--- .sdk/lib/fancy_urllib/fancy_urllib/__init__.py
+++ .sdk/lib/fancy_urllib/fancy_urllib/__init__.py
@@ -384,7 +384,7 @@ class FancyProxyHandler(urllib2.ProxyHandler):
class FancyHTTPSHandler(urllib2.HTTPSHandler):
"""An HTTPSHandler that works with CONNECT-enabled proxies."""
- def do_open(self, http_class, req):
+ def do_open(self, http_class, req, **http_conn_args):
proxy_authorization = None
for header in req.headers:
#!/usr/bin/env bash
for orig in "$@"
do
flac --decode --stdout "$orig" | lame -b 320 - "${orig%.flac}.mp3"
done
@zeekay
zeekay / less2stylus.js
Last active August 29, 2015 14:15 — forked from cvan/less2stylus.js
// Usage : less2stylusDir('../src/css/');
var fs = require('fs');
// this less 2 stylus conversion script make a stylus easy to read syntax
// - let the braces
// - replace the @ for var as $
// - let semicolons
function less2stylus(less)
package gochimp3
import (
"encoding/json"
"strings"
"time"
)
func (address *Address) MarshalJSON() ([]byte, error) {
tmp := struct {
@zeekay
zeekay / candle.markdown
Created September 16, 2016 23:55
Candle