Skip to content

Instantly share code, notes, and snippets.

for JS in $(find . -name "*.js")
do
echo Processing $JS
echo "alert(\"Starting $JS\");" > $JS.new
cat $JS >> $JS.new
mv $JS.new $JS
done
window.onerror = function(e, u, l) {
alert("Error: " + e);
return true;
};
#!/bin/sh
F=myFont.ttf
DATAURI=$(uuencode -m $F processed | grep -v begin-base64 | grep -v "====" | tr -d "\n")
echo '
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
logData 0
// bring up the login screen
navigate http://wal.sh/form/login.html
logData 1
// log in
setValue name=registrationIdId someuser@aol.com
setValue name=password somepassword
#!/usr/bin/perl
use strict;
use LWP::UserAgent;
use JSON;
my $ua = new LWP::UserAgent;
$ua->agent("wal.sh/0.0");
my $graph_base = "https://graph.facebook.com/";
#!/bin/sh
# POC of a CLI sprite generator
# This should mirror the behavior (i.e., default generation) of online scripts
# http://spritegen.website-performance.org/
# Usage: Run from the directory of images that should be sprited
# TODO: Just use files on the command line
# TODO: Convert to Python
# Setup: Populate ~/.spritesrc to change any of default values noted below
#!/bin/sh
#sudo gem install compass
# This will generate the following error:
# ERROR: While executing gem ... (Gem::RemoteSourceException)
# HTTP Response 302 fetching http://gems.rubyforge.org/yaml
sudo gem install rubygems-update --source http://production.s3.rubygems.org/
sudo gem update --system --source http://production.s3.rubygems.org/
#!/bin/sh
# Review: Style, nomenclature, structure, and performance
for G in http://github.com/janl/mustache.js.git http://github.com/jquery/jquery-tmpl.git http://github.com/documentcloud/underscore.git http://github.com/donnerjack13589/nTPL.git http://github.com/SamuraiJack/Shotenjin-Joosed.git http://github.com/fitzgen/tempest.git http://github.com/atduskgreg/srender.git http://github.com/trix/nano.git
do
git clone $G
done
# http://dojotoolkit.org/reference-guide/dojo/replace.html - Not the core framework
@jwalsh
jwalsh / gist:634398
Created October 19, 2010 15:38
.emacs
(setq load-path (cons (expand-file-name "~/lisp") load-path))
(autoload 'js2-mode "js2" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
(setq load-path (cons (expand-file-name "~/sandbox/nodelint.js/examples/emacs") load-path))
(require 'flymake-nodelint)
(add-hook 'javascript-mode-hook
(lambda () (flymake-mode t)))
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}