Skip to content

Instantly share code, notes, and snippets.

@taboularasa
taboularasa / yelpSoup.py
Created November 27, 2011 22:47
list of cities and categories in yelp
from BeautifulSoup import BeautifulSoup
import urllib2
f = urllib2.urlopen('http://www.yelp.com/developers/documentation/neighborhood_list')
raw = f.read()
soup = BeautifulSoup(raw)
places = soup.find('ul', {'class':'attr-list'})
@taboularasa
taboularasa / gist:1314844
Created October 26, 2011 00:00
select everything but a certain category
$("article").not(".category-tutorials").hide();
@taboularasa
taboularasa / version1.js
Created October 24, 2011 22:48
Here is the loop to get all the text from in the ancor tags
for (i = 0; i < items.length ; i ++){console.log($(items[i]).html());}
@taboularasa
taboularasa / gist:1269165
Created October 7, 2011 00:57
IR Target 3
String inString = "";
boolean keepReading = false;
const int ledPin = 13;
const int irTarget = 2;
int ledState = LOW;
unsigned long previousMillis = 0;
long interval = 0;
unsigned long offTime = 0;
boolean isOff = false;
String inString = ""; // string to hold input
// constants won't change. Used here to
// set pin numbers:
const int ledPin = 13, irTarget = 2; // the number of the LED pin
// Variables will change:
int ledState = LOW; // ledState used to set the LED
long previousMillis = 0; // will store last time LED was updated
@taboularasa
taboularasa / gist:1265448
Created October 5, 2011 19:40
Flatland Arduino serial test
void toggleLed();
String inString = "";
boolean keepReading = false;
const int ledPin = 13;
const int irTarget = 2;
int ledState = LOW;
unsigned long previousMillis = 0;
long interval = 0;
const int player = 'A';
B1 = 407C4414
B2 = 407C4427
B3 = 407C441C
B4 = 407C441A
B5 = 407C4421
O1 = 407C440E
O2 = 407C441E
O3 = 407C4412
O4 = 407C441B
@taboularasa
taboularasa / blimp.txt
Created August 3, 2011 21:57
Movid preset for Flatland player position tracking
pipeline create Camera v
pipeline create GrayScale g
pipeline create Threshold t
pipeline set t threshold 150
pipeline create BlobFinder b
pipeline create GreedyBlobTracker tr
pipeline create Tuio tu
pipeline set tu ip 149.142.121.154
#pipeline create ImageDisplay d1
#pipeline create ImageDisplay d2
@taboularasa
taboularasa / compare.py
Created April 8, 2011 03:03
compare sample to patterns and find closest match
def compare():
results = []
results['attack'] = distance(test, attack)
results['scan'] = distance(test, scan)
results['build'] = distance(test,build)
return min(results, key = lambda x: results.get(x))
def distance(a,b):
total = 0
for i in range(len(a)):
float cubeSize = 80;
color boxFill;
float rotYTarget = 0;
float rotXTarget = 0;
float rotationY = 0;
float rotationX = 0;
void setup()
{
size(640,640, P3D);
//smooth();