This file contains hidden or 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 very simple jQuery slideshow. It requires a little more work | |
// on the part of the user, but this keeps the transition code tiny. | |
// ----------------------------------------------------------------- | |
// CSS | |
// ----------------------------------------------------------------- | |
#slideshow { width:200px; height:200px; } | |
.hidden { display:none; } | |
// ----------------------------------------------------------------- |
This file contains hidden or 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/python | |
# this script will fetch all your Tumblr posts into a single big JSON file | |
# TODO- authenticate (fetch private posts) | |
# TODO- fetch referenced media? | |
import urllib2 | |
import simplejson as json | |
start = 0 |
This file contains hidden or 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/python | |
# Incredibly cackhanded Twitter backup. Needs *lots* of work. | |
import urllib2 | |
import simplejson as json | |
import base64 | |
page = 1 |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8" ?> | |
<!DOCTYPE grammar PUBLIC "-//W3C//DTD GRAMMAR 1.0//EN" "http://www.w3.org/TR/speech-grammar/grammar.dtd"> | |
<grammar xmlns="http://www.w3.org/2001/06/grammar" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.w3.org/2001/06/grammar | |
http://www.w3.org/TR/speech-grammar/grammar.xsd" | |
xml:lang="en-US" | |
version="1.0" | |
root="command" |
This file contains hidden or 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
<html><head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<script id="shader-fs" type="x-shader/x-fragment"> | |
void main() { | |
gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); | |
} | |
</script> |
This file contains hidden or 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
<<<<<<< Updated upstream | |
#!/usr/bin/python | |
import flickrapi # http://stuvel.eu/projects/flickrapi | |
import json as simplejson | |
import urllib2 | |
api_key = '' | |
api_secret = '' | |
photoset_id = '' |
This file contains hidden or 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
<script type="text/javascript"> | |
var since = '<%= @since.to_f %>'; | |
var updater = setInterval( function() { | |
new Ajax.Updater('notes','/poller', { | |
method:'get', | |
parameters:"since="+since, | |
insertion:'top', | |
onSuccess:function(r) { since = r.responseText; } | |
}) | |
}, 4000); |
This file contains hidden or 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
""" | |
Fetch people for Twitalyzer's mechanical turk. Will fetch and submit | |
Twitalyzer turk people forever with DELAY seconds between each pull. | |
Hit Ctrl-C (OSX, Linux) or Ctrl-D (Windows) to stop. | |
To use, just run: | |
> python twitalizer_turk.py |
This file contains hidden or 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
""" | |
Convert numbers from base 10 integers to base X strings and back again. | |
Sample usage: | |
>>> base20 = BaseConverter('0123456789abcdefghij') | |
>>> base20.from_decimal(1234) | |
'31e' | |
>>> base20.from_decimal('31e') | |
1234 |
This file contains hidden or 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 PIL import Image, ImageColor, ImageDraw | |
import itertools | |
im = Image.open("real.jpg") | |
pix = im.load() | |
draw = ImageDraw.Draw(im) | |
def colorTargetMatch(c): | |
if c[0] < 235 and c[0] > 192: #red | |
if c[1] < 190 and c[1] > 130: #green |