This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See, I need to have handlebars.js load partials from mongodb. | |
# So I start by monkey patching handlebars `invoke partial` function... | |
handlebars.VM.original_invokePartial = handlebars.VM.invokePartial | |
handlebars.VM.invokePartial = (partial, name, context, helpers, partials, data) -> | |
# Then I try to find the partial in the DB... | |
Partial.findOne { fullpath: name.split '.' }, (err, p) => | |
if p? | |
# ..and I use the loaded partial if it exists | |
handlebars.VM.original_invokePartial(p.partial, name, context, helpers, partials, data) | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Chuck Mangione, Esther Satterfield - The Land of Make Believe - Live Vocal (1973/Massey Hall, Toronto) | |
Professor Penguin - Pilot | |
Remember Remeber - Scottish Widows | |
The Lovin' Spoonful - Darling Be Home Soon | |
McDonald & Giles - Tomorrow's People - The Children of Today | |
Eagles of Death Metal - I Only Want You | |
DJ Format feat. Edan - Spaceship Earth | |
Nitrogods - Whiskey Wonderland | |
Sonic Youth - Kool Thing | |
Ljodahått - Så stig da i meg, einsemd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Snehvit:web_app anders$ guard-jasmine | |
Run Jasmine at http://127.0.0.1:3000/jasmine | |
{ | |
"passed": true, | |
"stats": { | |
"specs": 1, | |
"failures": 0, | |
"time": 0.008 | |
}, | |
"suites": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Vis= | |
Routers: {} | |
Collections: {} | |
Models: {} | |
Views: {} | |
init: (args) -> | |
args = {} unless args? | |
args['router'] = new Vis.Routers.Main() unless args['router']? | |
args['route'] = '' unless args['route']? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LiquidTemplatedController < ApplicationController | |
include Locomotive::Routing::SiteDispatcher | |
include Locomotive::Render | |
before_filter :require_site | |
protected | |
def render_with_template(*args) | |
template_path = args.select {|arg| arg.is_a?(Hash) && arg.has_key?(:template_path)}.first[:template_path] rescue 'index' | |
args.reject! {|arg| arg.is_a?(Hash) && arg.has_key?(:template_path)} | |
page_partial = render_to_string(*args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file contains brushed up version of all the examples I programmed live during the talk. | |
# CoffeeScript compiles to JavaScript | |
numbers = [1,2,3,4] # No need for semicolons! | |
location = conference = "NDC 2011" # Multiple assigns. | |
awake = false | |
console.log location # No need for parens! | |
# Run, Build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Open .bashrc | |
2) Replace... | |
[ -z "$PS1" ] && return | |
..with... | |
if [[ -n "$PS1" ]]; then | |
3) Add this to the end of your .bashrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts %q( | |
/***** | |
* This is a test program with 5 lines of code | |
* \/* no nesting allowed! | |
//*****//***/// Slightly pathological comment ending... | |
public class Hello { | |
public static final void main(String [] args) { // gotta love Java | |
// Say hello | |
System./*wait*/out./*for*/println/*it*/("Hello/*"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Del Close & John Brent - Basic Hip | |
Reuben Bell - Superjock | |
Archaeopterix - Samstag Abend, Sonntag Morgen | |
Les Maledictus Sound - Kriminal Theme | |
Joe Cogra Group - Darkness | |
Googoosh - Talagh | |
Lord Cobra Y Los Hnos. Duncan - Love Letters | |
Lonnie Mack - Too Much Trouble | |
Boobpa Saichol - Seng Rabird | |
Colosseum - The Kettle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function.prototype.memoize = function() { | |
var fn=this; | |
var args = Array.prototype.slice.call(arguments); | |
var target = args.length > 0 ? args[0] : null; | |
fn._vals = fn._vals || {}; | |
return function() { | |
var call_args = Array.prototype.slice.call(arguments); | |
if (fn._vals[call_args] !== undefined) return fn._vals[call_args]; | |
fn._vals[call_args] = fn.apply(target, arguments); | |
return fn._vals[call_args]; |