Skip to content

Instantly share code, notes, and snippets.

@dmzza
dmzza / Contract Killer 3.md
Last active September 23, 2018 08:20 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@dmzza
dmzza / upload.rb
Last active December 10, 2016 09:13 — forked from openfirmware/upload.rb
# Potential solution to "Using accepts_nested_attributes_for with a belongs_to association, and using find_or_create_by_attr behaviour"
# http://stackoverflow.com/questions/2970255/using-accepts-nested-attributes-for-with-a-belongs-to-association-and-using-find
class Upload < AR:B
belongs_to :user
belongs_to :observed_property
belongs_to :sensor
attr_accessor :observed_property_attributes,
:sensor_attributes
@dmzza
dmzza / gist:5448364
Last active December 16, 2015 14:20
javascript: function iprl5() % 7Bvar d = document,
z = d.createElement('scr' + 'ipt'),
b = d.body,
l = d.location;
try % 7Bif(!b) throw (0);
d.title = '(Saving...) ' + d.title;
z.setAttribute('src', l.protocol + '//localhost:5000/listings/91.js');
b.appendChild(z); % 7Dcatch(e) % 7Balert('Please wait until the page has loaded.'); % 7D % 7Diprl5();
void(0)
@dmzza
dmzza / titleCaps.js
Created November 2, 2012 18:48 — forked from gasi/titleCaps.js
Title Caps (JavaScript)
/*
* Title Caps
*
* Ported to JavaScript By John Resig - http://ejohn.org/ - 21 May 2008
* Original by John Gruber - http://daringfireball.net/ - 10 May 2008
* License: http://www.opensource.org/licenses/mit-license.php
*/
(function(){
var small = "(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v[.]?|via|vs[.]?)";
@dmzza
dmzza / bound_helper.js
Created September 26, 2012 16:50 — forked from ghempton/bound_helper.js
Ember Bound Handlebars Helper Utility
// This file contains utilities for creating bound helpers
// For reference: https://github.com/wagenet/ember.js/blob/ac66dcb8a1cbe91d736074441f853e0da474ee6e/packages/ember-handlebars/lib/views/bound_property_view.js
Ember.Handlebars.BoundHelperView = Ember.View.extend(Ember._Metamorph, {
context: null,
options: null,
property: null,
// paths of the property that are also observed
propertyPaths: [],
@dmzza
dmzza / index.html
Created July 17, 2012 19:59 — forked from timoxley/index.html
simple example using ember router and connect outlet
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Ember.js Router Example</title>
<meta name="description" content="Example of a basic Ember.js application with a Router" />
<meta name="author" content="http://codebrief.com" />
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
@dmzza
dmzza / backbone-ember-back-and-forth-transcript.txt
Created June 13, 2012 06:16 — forked from jashkenas/backbone-ember-back-and-forth-transcript.txt
Backbone.js vs Ember.js [Jeremy Ashkenas (jashkenas) and Yehuda Katz (wycats)] - Abridged Version
For those folks not already hanging out in #documentcloud... here's the log of this afternoon's Ember/Backbone politics discussion.
12:21 PM <wycats> how would you like me to describe backbone?
12:21 PM <wycats> let's work this out for once and for all :)
12:21 PM <wycats> I'm definitely not intentionally saying incorrect things about backbone
12:24 PM <jashkenas> don't worry about it too much -- I'm just not terribly pleased with backbone being continued to be used as the strawman...
12:24 PM <wycats> jashkenas: I am worried about it a lot
12:25 PM <wycats> jashkenas: what particularly am I saying that is unfair?
12:25 PM <jashkenas> If we're going to continue making intentionally slanted direct comparisons, then perhaps we should just add "Why Ember and not Backbone" and "Why Backbone and not Ember" sections to our respective sites ... so folks can at least read both sides.
12:27 PM <jashkenas> The main point is that all of the specific bits that you call out as limitations of Backbone, that Ember tries t