This baby registers an Ember Handlebars helper using @aterrien's awesome jQuery-Knob
Usage:
and vuala!!! you've got yourself a knob. options:
// 203774823 Gal Schlezinger | |
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#define NUM_OF_ARGS 3 | |
#define CLI_LENGTH 256 |
/** | |
* usage: function() {}.proxy(bla) | |
* bla will be 'this' in the function context. | |
**/ | |
Function.prototype.proxy = function(sup) { | |
var thiz = this; | |
var args = arguments; | |
return function() { | |
return thiz.apply(sup, args); |
development: | |
sessions: | |
default: | |
database: sinatraStam_test | |
hosts: | |
- localhost:27017 |
# Adds "id" and "date_created" to the mongoid document. | |
# "id" => "_id" | |
# "date_created" => "_id.generation_time" | |
# YEAH. thats it. | |
module Mongoid | |
module Document | |
def as_json(options={}) | |
attrs = super(options) | |
attrs["id"] = self.persisted? ? self._id : nil | |
attrs["date_created"] = self.persisted? ? self._id.generation_time : nil |
// ember-timeago.js | |
// Using momentjs to provide neat helper for fromNow() calls. | |
App.Clock = Em.Object.create({ | |
seconds: 0, | |
minutes: 0, | |
hours: 0, | |
init: function() { | |
this.tick(); | |
}, |
This baby registers an Ember Handlebars helper using @aterrien's awesome jQuery-Knob
Usage:
and vuala!!! you've got yourself a knob. options:
// USAGE: | |
// flick(function(willBeNull, next) { next("hey"); }).then(....).then(...); | |
var PPromise = function(callback) { | |
this.thenCallback = function() {}; | |
this.next = function() {}; | |
this.data = null; | |
this.resolved = false; | |
this.nextPromise = null; | |
} |
// {{source-wat}} | |
App.SourceWatComponent = Ember.Component.extend({ | |
attributeBindings: ['draggable'], | |
draggable: 'true', | |
dragStart: function(e) { | |
console.log("drag start"); | |
} | |
}); | |
// {{dest-wat}} |