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 script to pull some inspiring images | |
test | |
kawandeep virdee | |
@kawantum | |
''' | |
import xml.dom.minidom as XML | |
import urllib2 as URL |
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 scraperwiki | |
import lxml.html | |
import re | |
html = scraperwiki.scrape("http://www.accesstomedicineindex.org/content/index-2010-0") | |
root = lxml.html.fromstring(html) | |
data = {} | |
table = root.cssselect("tbody")[0] | |
for tr in table.cssselect("tr"): |
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 | |
#the video recordings in my phone are in .3gp | |
#so i wrote this to convert .3GP to .mp4 | |
# | |
#http://whichlight.com/blog/mobile-video-recording-convert-from-3gp-to-mp4/ | |
LIST=`ls *.3gp` | |
for i in $LIST; | |
do ffmpeg -i $i -sameq -ab 64k -ar 44100 ${i%3gp}mp4 | |
done |
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
//grid of arrows directed by mouse | |
//Kawandeep Virdee | |
//interesting things happen when you change the direction of the | |
// vector that is the difference between the mouse and the point. | |
PVector[][] grid; | |
int width=400; | |
int height=500; |
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
''' | |
flask-tweepy-oauth | |
an example showing how to authorize a twitter application | |
in python with flask and tweepy. | |
find the rest of the app here: https://github.com/whichlight/flask-tweepy-oauth | |
''' |
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
//see whichlight.com/blog/writing-a-web-scraper-over-http-with-nodejs for details | |
app.get('/pullstagram/:link?', function(req,res){ | |
url = req.params.link; | |
console.log(url); | |
request(url,function(err,response,body){ | |
if (!err && response.statusCode == 200) { | |
var window = jsdom(body).createWindow(), | |
$ = require('jquery').create(window); | |
var val = $('.photo').attr('src'); |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<script type='text/javascript' src='http://static.firebase.com/demo/firebase.js'></script> | |
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script> |
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
/* | |
This code will click like's currently loaded | |
on a facebook page. It's likely in the future | |
the name of the classes may change. | |
Be careful though, if you do too many at once | |
you'll get a warning. | |
To use this copy and paste it to your browser's | |
javascript console, or add javascript: to the |
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 flask import Flask | |
import flask | |
from twilio.rest import TwilioRestClient | |
import re | |
import random | |
import twilio.twiml | |
import os | |
''' | |
A snippet of a twilio app, using GET and POST |
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
int pingPin = 13; | |
int inPin = 12; | |
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() | |
{ | |
// establish variables for duration of the ping, |
OlderNewer