Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View themartorana's full-sized avatar

Dave Martorana themartorana

View GitHub Profile
173.12.5.73 - - [09/Dec/2010:15:18:46 --0500] [cs.stageshirts.com/sid#7fd84be131e0][rid#7fd84c23e748/initial] (2) init rewrite engin
e with requested uri /images/A1/15/A1154D-LG.jpg
173.12.5.73 - - [09/Dec/2010:15:18:46 --0500] [cs.stageshirts.com/sid#7fd84be131e0][rid#7fd84c23e748/initial] (3) applying pattern '
/display_materials.aspx' to uri '/images/A1/15/A1154D-LG.jpg'
173.12.5.73 - - [09/Dec/2010:15:18:46 --0500] [cs.stageshirts.com/sid#7fd84be131e0][rid#7fd84c23e748/initial] (3) applying pattern '
/default.aspx' to uri '/images/A1/15/A1154D-LG.jpg'
173.12.5.73 - - [09/Dec/2010:15:18:46 --0500] [cs.stageshirts.com/sid#7fd84be131e0][rid#7fd84c23e748/initial] (3) applying pattern '
/default_plus_size_shirts.aspx' to uri '/images/A1/15/A1154D-LG.jpg'
173.12.5.73 - - [09/Dec/2010:15:18:46 --0500] [cs.stageshirts.com/sid#7fd84be131e0][rid#7fd84c23e748/initial] (3) applying pattern '
/about_choice.aspx' to uri '/images/A1/15/A1154D-LG.jpg'
var countdown = (function() {
var index;
function log(){
console.log(index);
}
function iterate(){
log();
if(index>1) setTimeout(iterate, 1000);
@themartorana
themartorana / Caching Wrapper.js
Created January 21, 2011 15:12
Caching Wrapper.js
// Part 1.
// Implement a function prototype extension that caches function results for
// the same input arguments of a function with one parameter.
//
// For example:
// Make sin(1) have the result of Math.sin(1), but use a cached value
// for future calls.
//
// Part 2.
// Use this new function to refactor the code example.
@themartorana
themartorana / Inheritance Homework.js
Created January 21, 2011 15:13
Inheritance Homework
// 1. Write a class to support the following code:
// var thomas = new Person('Thomas');
// var amy = new Person('Amy');
//
// thomas.name // --> "Thomas"
// 2. Add a getName() method to all Person objects, that outputs
// the persons name.
@themartorana
themartorana / Event listener homework.html
Created January 21, 2011 18:45
Event listener homework
<div id="the_div">
<ul id="the_list">
<li id="the_item">Click me!</li>
</ul>
</div>
<p id="log"></p>
<!--
1. Change the addEventListener calls so that the events occur in the following order.
@themartorana
themartorana / sprockets_command_line
Created February 13, 2011 18:02
Sprockets command-line
sprocketize -C /Users/dave/code/Python/django-sites/hae/content/js -I hae -I vendor hae.js > /Users/dave/code/Python/django-sites/hae/content/js/sprockets.js
@themartorana
themartorana / hae.js
Created February 13, 2011 18:07
Default JS file
//= require "vendor/prototype.s2"
HAE = {
}
//= require "hae/attorney"
//= require "hae/hiringagency"
document.observe('dom:loaded', function() {
Element.addMethods({
import subprocess, shlex
import os
def sprocketize():
try:
import shlex, subprocess
js_path = os.path.abspath(os.path.join(os.getcwd(), '../content/js'))
sprocketize = "sprocketize -C %s -I hae -I vendor hae.js > %s/sprockets.js" % (
js_path,
js_path
kicker -e "sprocketize -C /Users/dave/code/Python/django-sites/hae/content/js -I hae -I vendor hae.js > /Users/dave/code/Python/django-sites/hae/content/js/sprockets.js" /Users/dave/code/Python/django-sites/hae/content/js
import os, subprocess, shlex
def start_kicker():
'''
Kick off Kicker and pass it our
sprocketize command-line argument
'''
try:
js_path = os.path.abspath(os.path.join(os.getcwd(), '../content/js'))
sprocketize = "sprocketize -C %s -I hae -I vendor hae.js > %s/sprockets.js" % (