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 | |
prog=$(basename $0) | |
logger="logger -t $prog" | |
# Logs to syslog and stderr | |
gripe () { | |
$logger -s "$*" | |
} |
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
/** | |
* A simple preforking echo server in C. | |
* | |
* Building: | |
* | |
* $ gcc -Wall -o echo echo.c | |
* | |
* Usage: | |
* | |
* $ ./echo |
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 urllib, re | |
from pprint import pprint as pp | |
from datetime import datetime, timedelta | |
from geopy.geocoders import Google | |
import MySQLdb | |
from time import sleep | |
bcpd_arc_url = "http://maps.baltimorepolice.org/servlet/com.esri.esrimap.Esrimap?ServiceName=BaltimorePolice&CustomService=Query&ClientVersion=3.1&Form=True&Encode=False" | |
districts={"Northwest": |
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
Rush Limbaugh all tore into him as nominee, could completely | |
alter the structure of her considerable enthusiasm into | |
persuading even the rare greater red horse that make solar cells, | |
a Ways and Means they are also, by and large ways, in gentler, | |
politer interactions with ministers and churches. That's really | |
how I first came into this thinking it was easy to surmise that | |
the mainstream of his shot-up airplane that paralyzed his right | |
arm paralyzed. Or the story of the world over, and scapegoating | |
the brown-skinned Other who is seeking an exemption in the | |
country--and board chair Hank Dittmar, an expert on ... |
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
(def state (ref {})) | |
(def nonword "\n") | |
(defn get-words | |
[] | |
(loop [words []] | |
(let [line (read-line)] | |
(if (nil? line) | |
words |
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
FF 3.5 | |
| Run | String(fn) | fn + "" | | |
|-----+-------------+-----------| | |
| 1 | 0.658 | 0.617 | (time in sec.) | |
| 2 | 0.666 | 0.617 | | |
| 3 | 0.651 | 0.61 | | |
| 4 | 0.651 | 0.611 | | |
| 5 | 0.653 | 0.621 | | |
|-----+-------------+-----------| |
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 urllib, re | |
from pprint import pprint as pp | |
from datetime import datetime, timedelta | |
from geopy.geocoders import Google | |
import MySQLdb | |
from time import sleep | |
bcpd_arc_url = "http://maps.baltimorepolice.org/servlet/com.esri.esrimap.Esrimap?ServiceName=BaltimorePolice&CustomService=Query&ClientVersion=3.1&Form=True&Encode=False" | |
districts={"Northwest": |
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 | |
set -e -x | |
export DEBIAN_FRONTEND=noninteractive | |
apt-get update && apt-get install -y siege | |
siege -c 100 --time=10m --user-agent="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.2pre) Gecko/20100207 Ubuntu/9.10 (karmic) Namoroka/3.6.2pre" http://ec2-174-129-96-143.compute-1.amazonaws.com/index.html | |
shutdown -h now |
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 | |
""" | |
Tallies up the geocoded tweets and geo-enabled users in your Twitter social graph / friend | |
timeline, at most for the last 3,200 friend tweets (as rate-limited by the Twitter API) | |
Prints some stats to stderr, the geocoded tweets in JSON format to stdout | |
I would execute it like so: | |
$ ./geo_tweet_stats.py username password | tee geotweets.json |
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 urllib, os, time, glob, urlparse, errno, sys, getpass, re | |
from xml.dom.minidom import parseString as parse | |
API_PATH = '/api/read' | |
MAX_NUM_PER_REQUEST = 50 | |
class BadLogin(Exception): pass | |
def make_api_url(tumblr): |
OlderNewer