Skip to content

Instantly share code, notes, and snippets.

View bcardarella's full-sized avatar
Out sailing

Brian Cardarella bcardarella

Out sailing
View GitHub Profile
def render_subject(context)
render subject, context
end
def render_content(context)
render content, context
end
private
@bcardarella
bcardarella / config.ru
Created April 7, 2012 17:45 — forked from soveran/config.ru
Smaller Sinatra App
require 'sinatra'
get('/') { 'Hello world' }
@bcardarella
bcardarella / uri.js
Created April 21, 2012 04:22 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.host; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
@bcardarella
bcardarella / gist:3118576
Created July 15, 2012 20:50 — forked from lporras/gist:2403098
Using Backbone Views With Rails jQuery-ujs
var FormView = Backbone.View.extend({
el: '#form',
events: {
// Fired automatically when a file-type input is detected with a
// non-blank value. You can use this hook to implement a handler that
// will deal with those non-blank file inputs. Returning false will
// disallow standard form submission.
'ajax:aborted:file' : 'ajaxAbortedFile',

It All Starts With Templates

An Ember application starts with its main template. Put your header, footer, and any other decorative content in application.handlebars.

<header>
  <img src="masthead">
</header>

<footer>