Skip to content

Instantly share code, notes, and snippets.

# Intended Behavior:
ExternalContactList.type_to_class('facebook') # => ExternalContactList::Facebook
UserIdentifier.type_to_class('facebook') # => UserIdentifier::Facebook
UserIdentifier::Facebook.type_to_class('facebook') # => UserIdentifier::Facebook
# Actual Behavior
ExternalContactList.type_to_class('facebook') # => UserIdentifier::Facebook
UserIdentifier.type_to_class('facebook') # => UserIdentifier::Facebook
/**
* Path Set
* A libary for storing and generating paths for an application based on params
* @author Tal Atlas <[email protected]>
*
* ps = new PathSet({
* root: '/',
* album: '/albums/:id(.:format)',
* album_pictures: '/albums/:album_id/pictures(/:id)(.:format)'
* });
development: &defaults
# Configure available database sessions. (required)
sessions:
# Defines the default session. (required)
default: &default_session
# Defines the name of the default database that Mongoid can connect to.
# (required).
database: delight_development
# Provides the hosts the default session can connect to. Must be an array
# of host:port pairs. (required)
console.originalLog = console.log;
console.log = function() {
console.log.history = console.log.history || [];
console.log.history.push(arguments);
console.originalLog.apply(null,arguments);
}
@tal
tal / klass.new.js
Created January 18, 2012 19:28
Changing the way to define classes in js
GC.util.classSetup('GC.Page.Klass', function() {
return {
val1: val1,
val2: val2
}
});
diff --git a/src/main/webapp/WEB-INF/public/javascripts/gilt/notify.js b/src/main/webapp/WEB-INF/public/javascripts/gilt/notify.js
index 604fba9..747b7fb 100644
--- a/src/main/webapp/WEB-INF/public/javascripts/gilt/notify.js
+++ b/src/main/webapp/WEB-INF/public/javascripts/gilt/notify.js
@@ -44,6 +44,7 @@ Gilt.Notify = Gilt.Notify || (function () {
subscribeMany,
unsubscribe,
unsubscribeMany,
+ NAMESPACE_SPLIT = '.',
log = Gilt.Util.logger("notify", "Notify");
@tal
tal / gist:1558164
Created January 4, 2012 02:32
Carousel slide interactions
class Visible
constructor: (@slides) ->
push: (slide) ->
slide.set('far_right')
@slides.push(slide)
unshift: (slide) ->
slide.set('far_left')
@slides.unshift(slide)
function PageParams() {}
GC.pageParams = new PageParams();
_.each(window.location.search.replace(/^\?/,'').split('&'), function(paramSet) {
var array = paramSet.split('=');
GC.pageParams[array[0]] = array[1];
});
@tal
tal / woody.rb
Created November 10, 2011 18:32
#! /usr/bin/env ruby
require 'fileutils'
require 'pathname'
def system(*args)
puts(" ++ #{args.join(' ')}")
Kernel.system(*args)
end
def notify(msg,level=2)
#!/usr/bin/env coffee
optparse = require('./optparse')
console.log module
fi = require('findit')
path = require('path')
util = require('util')
cp = require('child_process')
DEFAULT_PATH = './public/javascripts'
BANNER = "Usage: woody [options] path/to/javascripts\n\nIf called without options, `woody` will default to #{DEFAULT_PATH}"