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 json | |
import urllib | |
import time | |
def search_twitter(query, callback, maxpages=10): | |
resp = urllib.urlopen('http://search.twitter.com/search.json%s' % query) | |
data = json.loads(resp.read()) | |
for item in data['results']: | |
callback(item) | |
if 'next_page' in data and maxpages > 1: |
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 twitter_search import search_twitter | |
import random | |
import sys | |
import re | |
class Thingy(object): | |
def __init__(self, words): | |
self.words = words | |
self.begins = dict([(word, []) for word in words]) | |
self.ends = dict([(word, []) for word in 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
import array | |
wordlen = 8 | |
charwidth = 32 | |
charheight = 64 | |
def fillbuf(pg, font, word, buffer): | |
pg.beginDraw() | |
pg.background(0) | |
pg.fill(255) |
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 | |
import sys | |
import time | |
import json | |
import random | |
import re | |
# to get your own client id/client secret, go here: | |
# https://foursquare.com/oauth/ | |
foursq_client_id = sys.argv[1] |
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
# requires processing.py: https://github.com/jdf/processing.py | |
# | |
# you'll need pcsenior.ttf (from here: http://www.zone38.net/font/) in a data/ directory | |
# (though you can also use any font you'd like) | |
from random import randrange | |
class Cell(object): | |
def __init__(self, status): | |
self.current = status |
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
isobel:~ adam$ curl -s "https://search.twitter.com/search.json?q=everything&rpp=100" | python -mjson.tool | perl -nle 'print join " ", (split / /, $1)[0..5] if /"text":.*(everything [a-zA-Z ]+)",/i' | |
EVERYTHING RIGHT NOW OMG | |
EVERYTHING done by Hank G | |
everything new york | |
everything through crist who gives me | |
everything better | |
everything is | |
everything hard af he be looking | |
everything will happen in the last | |
everything in my power not to |
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
isobel:~ adam$ python -c 'import itertools, sys; [sys.stdout.write("e" + "".join(i) + "g\n") for i in itertools.permutations("everything"[1:-1])]' | head -50 | |
everything | |
everythnig | |
everytihng | |
everytinhg | |
everytnhig | |
everytnihg | |
everyhting | |
everyhtnig | |
everyhitng |
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
isobel:~ adam$ perl -le 'for $c ('a'..'z') { $_ = "everything"; s/[aeiou]/$c/g; print }' | |
avarythang | |
bvbrythbng | |
cvcrythcng | |
dvdrythdng | |
everytheng | |
fvfrythfng | |
gvgrythgng | |
hvhrythhng | |
ivirything |
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
isobel:~ adam$ perl -nle 'chomp;push@w,$_ if"everything"=~/$_/;END{{print join" ",map{$w[rand @w]}0..rand(4);print""if++$i%3==0;redo}}' <~/Documents/Code/sowpods.txt |head -40 | |
thin hi thing thin | |
every eve | |
thin very eve hing | |
eve every | |
eve hi hin | |
everything thin hin | |
er everything |
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
isobel:~ adam$ echo everything | perl -le 'print $_ x (ord($_) - ord('a')+1) for split //, <>' | |
eeeee | |
vvvvvvvvvvvvvvvvvvvvvv | |
eeeee | |
rrrrrrrrrrrrrrrrrr | |
yyyyyyyyyyyyyyyyyyyyyyyyy | |
tttttttttttttttttttt | |
hhhhhhhh | |
iiiiiiiii | |
nnnnnnnnnnnnnn |
OlderNewer