Instantly share code, notes, and snippets.

View SketchSystems.spec
Logged-out
Login
success -> Project List
failure -> Login
Logged-in*
search -> Search Results
logout -> Login
Project List
View golf.sh
awk 'NF {print $NF}' | tr a-z A-Z | tr -d .,\"\; |
xargs -n 1 -I % grep '^% ' cmudict-0.7b |
perl -lne 'if (/.*\b((AA|AE|AH|AO|AW|AY|EH|ER|EY|IH|IY|OW|OY|UH|UW).*)/) {print $1}' |
tr -d 0-9 | awk 'BEGIN{i=1} !seen[$0] {seen[$0]=i++} {print seen[$0]}' | tr 1-9 a-j | tr -d '\n'
View example
$ mkpop -i pokemon 100 zipf | sort | uniq -c | sort -rn
68 hoopa
12 diancie
7 zygarde
3 yveltal
2 xerneas
1 volcanion
1 trevenant
1 pumpkaboo
1 noivern
View crunch.py
from baseconv import BaseConverter
from flask import Flask, abort, make_response, redirect, request, url_for
from flask.ext.redis import FlaskRedis
app = Flask(__name__)
store = FlaskRedis(app)
converter = BaseConverter('23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz')
@app.route('/<shortcode>')
View redux-storage-engine-file.js
import fs from 'fs';
import tmp from 'tmp';
export default (filename) => ({
load() {
return new Promise((resolve, reject) => {
fs.readFile(filename, (err, contents) => {
if (err) {
if (err.code === 'ENOENT') {
resolve({})
View server.py
#!/usr/bin/env python
import cgi
import os
import mistune
from SimpleHTTPServer import SimpleHTTPRequestHandler
from SocketServer import TCPServer
from cStringIO import StringIO
View spotlight.py
#!/usr/bin/env python
# encoding: utf-8
from AppKit import *
from Foundation import *
from Cocoa import *
from PyObjCTools import AppHelper
View cap.sh
#!/usr/bin/env bash
set -e
declare fn
function cleanup {
rm "$fn"
}
trap cleanup EXIT
fn="$(mktemp -t cap).png"
View deps.awk
#!/usr/bin/env awk -f
/^[a-z]+ -> [a-z]+$/ { print $3, $1 }
/^[a-z]+ (AND|OR) [a-z]+ -> [a-z]+$/ { print $5, $3; print $5, $1 }
/^[0-9]+ (AND|OR) [a-z]+ -> [a-z]+$/ { print $5, $3 }
/^[a-z]+ (LSHIFT|RSHIFT) [0-9]+ -> [a-z]+$/ { print $5, $1 }
/^NOT [a-z]+ -> [a-z]+$/ { print $4, $2 }
View jsonform.py
# -*- coding: utf-8 -*-
import json
undefined = object()
class JSONFormEncoder(json.JSONEncoder):
def default(self, obj):
if obj == undefined:
return None