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
/* | |
* Abbreviated version of the yacc grammar used by at(1). | |
*/ | |
%token <charval> DOTTEDDATE | |
%token <charval> HYPHENDATE | |
%token <charval> HOURMIN | |
%token <charval> INT1DIGIT | |
%token <charval> INT2DIGIT | |
%token <charval> INT4DIGIT |
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 redis | |
r = redis.Redis() | |
base = 0 # Smallest allowed key in samples | |
jump = 50 # Key size bins | |
top = 1300 # Largest allowed key in sample | |
samples = 1000 # Numbers of samples | |
bins = [] | |
for i in xrange(1+(top-base)/jump): |
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
#!/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
(zcat $( ls -tr /var/log/apt/history.log*.gz ) ; cat /var/log/apt/history.log ) | egrep '^(Start-Date:|Commandline:)' | grep -v aptdaemon | egrep '^Commandline:' |
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
Prerequisites | |
* SHOUTcast (http://www.shoutcast.com/BroadcastNow) | |
* Soundflower (https://rogueamoeba.com/freebies/soundflower/) | |
* butt (http://butt.sourceforge.net/) | |
* a computer | |
Set up Soundflower | |
* After installing Soundflower, set it as Output source in System Preferences |
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 | |
// require glue lib | |
require 'glue.php'; | |
// create a glue object, and look up the neverending story in json format | |
// $glue->$method->$chain maps to api calls, like method/chain | |
// you can use any value, but glue will throw errors | |
$glue = new Glue('username', 'password'); | |
$response = $glue->object->get(array( | |
'objectId' => 'http://en.wikipedia.org/wiki/The_Neverending_Story', |
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 $u=$_GET['u'];$l=$u();extract($l);include("view/{$u}.php"); |
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
#!/bin/bash | |
# Prints a list of all committers in a subversion repository, | |
# sorted by number of commits. | |
# Written by Torsten Becker <torsten.becker@gmail.com> in 2011 | |
if [[ ! $1 ]]; then | |
echo "Usage: $0 SVN-REPO-URL" | |
exit 1 | |
fi |
OlderNewer