Skip to content

Instantly share code, notes, and snippets.

@zohararad
zohararad / some-worker.conf
Created November 21, 2014 10:11
Control several workers from the same master upstart script
description "Some Ruby Worker"
kill timeout 10
respawn
instance $INSTANCE
script
app=/var/deploy/myapp/production/current
@zohararad
zohararad / zepto.queue.js
Created August 21, 2013 08:31
jQuery queues port to Zepto. Use this to get Spine.js working with Zepto (needs Zepto deferred as well), or queue animations etc. Note that this code is a simple copy and paste of relevant functionality from jQuery 2.0.3
(function($){
// jQuery Data object
var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
rmultiDash = /([A-Z])/g,
expando = "Zepto" + ( '1.0' + Math.random() ).replace( /\D/g, ""),
optionsCache = {},
core_rnotwhite = /\S+/g,
core_deletedIds = [],
core_push = core_deletedIds.push;
@zohararad
zohararad / queue.js
Created May 25, 2013 08:38
Zepto.queue support for Spine.Ajax
$.fn.queue = function(){
var Q = function(){
this.q = [];
}
Q.prototype = {
enqueue: function(el){
if($.isArray(el)){
this.q = el;
@zohararad
zohararad / classify.js
Created January 21, 2011 10:59
Simply OOP capabilities in vanilla Javascript
/**
* Classify.js
* A simple implementation of a Class native in Javascript with support for private and public methods and properties.
* Inspired by MooTools Class.js and by the Module Javascript design pattern (for private and public methods and properties)
*
* Zohar Arad. February 2011
*
* Usage:
*
* var MyClass = new Class({