This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Logged-out | |
Login | |
success -> Project List | |
failure -> Login | |
Logged-in* | |
search -> Search Results | |
logout -> Login | |
Project List |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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({}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import cgi | |
import os | |
import mistune | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
from SocketServer import TCPServer | |
from cStringIO import StringIO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
from AppKit import * | |
from Foundation import * | |
from Cocoa import * | |
from PyObjCTools import AppHelper | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
declare fn | |
function cleanup { | |
rm "$fn" | |
} | |
trap cleanup EXIT | |
fn="$(mktemp -t cap).png" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import json | |
undefined = object() | |
class JSONFormEncoder(json.JSONEncoder): | |
def default(self, obj): | |
if obj == undefined: | |
return None |
NewerOlder