Skip to content

Instantly share code, notes, and snippets.

View nummi's full-sized avatar
😺
Working from home

Jerry Nummi nummi

😺
Working from home
View GitHub Profile
parent: {
child: {
child_revisions: {
route: '/revisions/:number',
deserialize: function(params) {
// params => { number: 1 }
// number is not a primary key,
// I need access to Child to find the Revision
}
}
@nummi
nummi / routes.js
Created August 7, 2012 22:48
Ember Routes
/*
root:
projects:
screens:
revisions:
Project has many Screens
Screen has many Revisions
/projects/1/screens/2/revisions/2
<html>
<head>
<style>
* { margin: 0; padding: 0; }
form {
display: table;
width: 400px;
background: #eee;
}
@nummi
nummi / application.rb
Created July 30, 2012 19:46
Rails precompile specific file
# Goes in config/application.rb
config.assets.precompile += ['file.css', 'file.js']
@nummi
nummi / gist:2781736
Created May 24, 2012 14:03 — forked from panayi/gist:2781592
Ember.js: Animating view with JQ.Animation mixin
JQ.Animate = Ember.Mixin.create({
cssProperties: ['background', 'backgroundAttachment', 'backgroundColor', 'backgroundImage', 'backgroundPosition',
'backgroundRepeat', 'border', 'borderBottom', 'borderBottomColor', 'borderBottomStyle', 'borderBottomWidth',
'borderColor', 'borderLeft', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRight', 'borderRightColor',
'borderRightStyle', 'borderRightWidth', 'borderStyle', 'borderTop', 'borderTopColor', 'borderTopStyle', 'borderTopWidth',
'borderWidth', 'clear', 'clip', 'color', 'cursor', 'display', 'filter', 'font', 'fontFamily', 'fontSize',
'fontVariant', 'fontWeight', 'height', 'left', 'letterSpacing', 'lineHeight', 'listStyle', 'listStyleImage',
'listStylePosition', 'listStyleType', 'margin', 'marginBottom', 'marginLeft', 'marginRight', 'marginTop', 'overflow',
'padding', 'paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop', 'pageBreakAfter', 'pageBreakBefore',
'position', 'styleFloat', 'textAlign', 'textDecoration'
@nummi
nummi / config.ru
Created April 9, 2012 19:20
Serve static files with Ruby and Rack
require 'rubygems'
require 'rack/rewrite'
use Rack::Rewrite do
rewrite '/', '/index.html'
end
use Rack::Static, :urls => ['/'], :root => "public"
run Rack::Directory.new('public')
@nummi
nummi / hack.sh
Created March 31, 2012 18:11 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@nummi
nummi / isoTransform.js
Created February 29, 2012 15:16 — forked from tdreyno/isoTransform.js
Isotope CSS3 jQuery cssHooks
// ========================= getStyleProperty by kangax ===============================
// http://perfectionkills.com/feature-testing-css-properties/
var getStyleProperty = (function(){
var prefixes = ['Moz', 'Webkit', 'Khtml', 'O', 'Ms'];
var _cache = { };
function getStyleProperty(propName, element) {
@nummi
nummi / nav.html
Created December 6, 2011 14:15
Navigation
<style>
* { margin: 0; padding: 0; }
body { padding: 20px; }
ul {
width : 200px;
list-style : none;
}
ul li a {
<style>
* { margin: 0; padding: 0; }
body { padding: 20px; }
ul {
width : 200px;
list-style : none;
}
ul li a {