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 sys | |
from calendar import timegm | |
from collections import Counter, defaultdict | |
from datetime import datetime, timedelta | |
import redis | |
class DictBackend(object): | |
def __init__(self, maximum=None): |
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
<?php | |
function foo($a, $b) { | |
echo "a: {$a} b: {$b}\n"; | |
} | |
$foo_caller = new PartialCallable('foo', array('A')); | |
$foo_caller('B'); | |
$foo_caller = partial_function('foo', 'A'); | |
$foo_caller('B'); |
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
<?php | |
/** | |
* The Bleb PHP Framework | |
* | |
* @author Justin Poliey <jdp34@njit.edu> | |
* @copyright BlebCT 2010 | |
* @package bleb | |
*/ | |
namespace Bleb { |
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
COFFEEC = coffee | |
SASSC = sass | |
HANDLEBARSC = handlebars | |
# Build app package | |
APPSRC = static/scripts/main.coffee | |
APPOBJ = ${APPSRC:.coffee=.js} | |
APPOUT = static/scripts/app.js |
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
#!/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
$ 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({}) |