Skip to content

Instantly share code, notes, and snippets.

@zilkey
zilkey / application layout
Created August 27, 2012 05:17 — forked from davidott/application layout
application layout
<!DOCTYPE html>
<html>
<head>
<title>Solar Sound Inc | Entertainment </title>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<style type="text/css">
body {
padding-top: 60px;
@zilkey
zilkey / ember-precompile.js
Created March 10, 2012 22:30 — forked from garth/Jakefile.js
Precompile .handlebars templates with node js
var fs = require('fs');
var vm = require('vm');
var emberjs = fs.readFileSync('public/javascripts/vendor/ember-0.9.5.min.js', 'utf8');
var templatesDir = 'templates';
var destinationDir = 'public/javascripts/templates';
function compileHandlebarsTemplate(templatesDir, fileName) {
var file = templatesDir + '/' + fileName;
@zilkey
zilkey / Terminal commands
Created December 28, 2011 06:23 — forked from davidott/Terminal commands
Trying to push to git and new controller /views
Davids-MacBook-Pro:blog daviddotterweich$ git.add
-bash: git.add: command not found
Davids-MacBook-Pro:blog daviddotterweich$ git.
-bash: git.: command not found
Davids-MacBook-Pro:blog daviddotterweich$ git. add
-bash: git.: command not found
Davids-MacBook-Pro:blog daviddotterweich$ git
usage: git [--version] [--exec-path[=<path>]] [--html-path]
[-p|--paginate|--no-pager] [--no-replace-objects]
[--bare] [--git-dir=<path>] [--work-tree=<path>]
#Taken from http://coderrr.wordpress.com/2008/04/22/building-the-right-class-with-sti-in-rails/
class GenericClass < ActiveRecord::Base
class << self
def new_with_cast(*a, &b)
if (h = a.first).is_a? Hash and (type = h[:type] || h['type']) and (klass = type.constantize) != self
raise "wtF hax!!" unless klass < self # klass should be a descendant of us
return klass.new(*a, &b)
end