Skip to content

Instantly share code, notes, and snippets.

View azoff's full-sized avatar
🏠
Working from home

Jonathan Azoff azoff

🏠
Working from home
View GitHub Profile
define(function (require) {
var module;
// Setup temporary Google Analytics objects.
window.GoogleAnalyticsObject = "ga";
window.ga = function () { (window.ga.q = window.ga.q || []).push(arguments); };
window.ga.l = 1 * new Date();
// Immediately add a pageview event to the queue.
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash
@azoff
azoff / woot.watcher.bookmarklet.js
Created October 20, 2010 07:22
A WootOff Watcher that uses AJAX and alerts to run right in your browser
javascript:(function(win,domain,$){var w={config:{interval:3000,alertOnNew:true,selector:".leadIn"},homePage:"http://"+domain+"/default.aspx ",init:function(){w.element=$(w.config.selector);w.fragment=w.homePage+w.config.selector;w.update();win.WootWatcher=w},getProduct:function(){return w.element.find("h2.fn").html()},isNewProduct:function(item){return w.lastProduct&&w.lastProduct!==item},update:function(){w.element.load(w.fragment,w.parse)},enqueue:function(){w.timeout=setTimeout(w.update,w.config.interval)},dequeue:function(){if(w.timeout){clearTimeout(w.timeout)}},parse:function(newProduct){newProduct=w.getProduct();if(w.isNewProduct(newProduct)){if(w.config.alertOnNew){alert(newProduct)}else{if(console){console.log(newProduct)}}}w.lastProduct=newProduct;w.enqueue()}};$(w.init)})(window,document.domain,jQuery);
@azoff
azoff / step1.piano.js
Created February 9, 2011 06:57
step1.piano.js
AUDIO_FOLDER = "path/to/instruments";
BROWSER_IMAGE = "path/to/browser.jpg";
<script src="jquery.js"></script>
<script src="jquery.watermark.js"></script>
<input type="text" name="a" title="Click here to type..." />
<textarea name="b"></textarea>
@azoff
azoff / step1.jwave.html
Created February 9, 2011 06:35
Installing jWave
<script src="jquery.js"></script>
<script src="jquery.jwave.js"></script>
@azoff
azoff / autodj.bookmarklet.js
Created July 7, 2011 06:13
Turntable.fm DJ Script
javascript:(function(g,d,f){if(f)d.info("Session found:",f);else return d.warn("No session found!");var h={check:10,wait:500},b=g.autodj={api:g[f],available:function(a){return b.api.taken_dj_map[a]<0},spot:function(){return b.api.become_dj.data("spot")},become:function(a){b.api.callback("become_dj",a)},waiter:function(a){return function(){return b.available(a)?(b.become(a),a):(d.info("Waiting..."),-1)}},seated:function(a){return b.api.djs[a]&&b.api.djs[a][0]===b.api.myuserid},wait:function(a,c){var e=c!==void 0,
a=a||h.check,c=c||b.spot();b.seated(c)?d.warn("Spot",c,"taken!"):(e&&d.error("Spot",c,"missed. Restarting..."),d.info("Polling @",a,"ms"),b.check(a,b.waiter(c)))},check:function(a,c){setTimeout(function(){var e=c.call(b);e>0?(d.warn("Spot",e,"open..."),setTimeout(function(){b.wait(a,e)},h.wait)):b.check(a,c)},a)}}})(window,console,function(g,d,f,h,b,a,c,e,i,j,k){try{return g(d)[f](h)[b][a][c][e]()[i](j)[k]}catch(l){return null}}(jQuery,".invite_dj","data","events","click",0,"handler","toString","match
@azoff
azoff / jquery.autoresize.tut.js
Created August 29, 2011 05:21
Running AutoResize
jQuery('textarea').autoResize();
@azoff
azoff / jquery.change.tut.js
Created November 7, 2011 02:41
Tutorials for jQuery.Changed
var inputs = $('input,select,textarea');
inputs.change(/* fn(event) */);
@azoff
azoff / embed.bookmarklet.js
Created January 13, 2012 01:47
Embed Enlarger
javascript:(function(embed%2Cbody)%7Bbody.appendChild(embed)%3Bembed.style.position%3D'absolute'%3Bembed.style.top%3D0%3Bembed.style.left%3D0%3Bembed.style.width%3D'100%25'%3Bembed.style.height%3D'100%25'%3Bembed.style.zIndex%3D999%7D)(document.querySelector('embed')%2C%20document.body)