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 | |
# -*- coding: utf-8 -*- | |
import json | |
import os | |
import sys | |
class InvalidJSONError(ValueError): | |
def __init__(self, key, *args, **kwargs): | |
self.key = key |
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 | |
# -*- coding: utf-8 -*- | |
import argparse | |
import sys | |
import textwrap | |
try: | |
from cStringIO import StringIO | |
except ImportError: | |
from StringIO 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 bash | |
set -e | |
B56ALPHABET="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz23456789" | |
if [[ "$REQUEST_METHOD" = "GET" ]]; then | |
URL=$(redis-cli get ${PATH_INFO:1}) | |
if [[ -z "$URL" ]]; then | |
echo "Status: 404 Not Found" | |
echo "Content-Type: text/plain" |
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
JS = $(wildcard scripts/*.js) | |
all: game.js game.js.map game.css rules.html | |
game.js: $(JS) | |
game.js.map: $(JS) | |
%.js %.js.map: | |
closure-compiler --js $(JS) --js_output_file $*.js --create_source_map $*.js.map --source_map_format V3 |
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 | |
$emp = Relation('emp'); | |
$dept = Relation('dept'); | |
/* | |
* SELECT * | |
* FROM emp | |
* WHERE rownum <= 5; | |
*/ | |
select($emp, $emp->field('rownum')->lte(5)) |
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 calendar | |
import datetime | |
import hashlib | |
import multiprocessing | |
import os | |
import re | |
import signal | |
import subprocess | |
import sys |
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 mimeparse | |
class ContentNegotiationMixin(object): | |
def not_acceptable(self, request): | |
return HttpResponse(status=406) | |
def get_acceptable(self, request): | |
return dict(self.accepts) |
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 os | |
import sqlite3 | |
from csvkit import table, CSVKitWriter | |
from csvkit.cli import CSVKitUtility | |
from csvkit.sql import make_create_table_statement, make_table |
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 argparse | |
import itertools | |
import os | |
import sys | |
import urllib | |
import urlparse | |
ERR_NO_SUCH_QUERY = 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import calendar | |
import sys | |
import rdbtools | |
def emit_protocol(*args): |