Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / 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)
$(function() {
$("input").each(function(i) {
streets = "Myrtle Ave and Hart St";
street = streets.split(" and ");
switch(i) {
case 0:
$(this).val(203.0);
break;
case 1:
$(this).val(400);
@dmzza
dmzza / gist:8682397
Last active January 4, 2016 21:39
Getting to the sqlite console for the iPhone Simulator
cd ~/Library/; cd 'Application Support'; cd 'iPhone Simulator'; cd 7.1-64/Applications; ls -l;
returns this:
drwxr-xr-x@ 6 david staff 204 Jan 26 08:21 1E58656A-CF95-4EB2-B69B-2C278EA3E135
drwxr-xr-x@ 6 david staff 204 Jan 26 08:21 67742A6D-A627-4854-9901-AB44C7AB6757
drwxr-xr-x@ 6 david staff 204 Jan 26 08:21 AD33D807-54A2-4CF8-9F18-7BD976E2A5FC
drwxr-xr-x@ 6 david staff 204 Jan 26 08:21 B3880242-ADEF-480B-8114-490FFCA37401
drwxr-xr-x@ 6 david staff 204 Jan 26 08:21 CC26D5B4-3200-4C0F-97BB-8D485CB4B3A9
drwxr-xr-x@ 6 david staff 204 Jan 29 00:19 DC73DACE-6141-4D69-9CDC-9B02002F62FB

Keybase proof

I hereby claim:

  • I am dmzza on github.
  • I am dmzza (https://keybase.io/dmzza) on keybase.
  • I have a public key whose fingerprint is 16BA 9112 15EC 8DA2 F1E4 36A6 930C 3955 D3C7 0BB4

To claim this, I am signing this object:

@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 / onboarding-outline.md
Last active May 10, 2016 22:45
Onboarding Outline and Notes

Current sign up process:

  1. phone number (or see social sign up below)
  2. confirmation code
  3. email address, mandatory for contact exchange (for now, but doesn't have to be)
  4. Missing profile information?
  • autofill:
    1. ask for contact permission
    2. either ask which contact you are or go to step 5
  • manual:
  1. goes to profile#edit where anything missing is highlighted (name is only found from the iPhone's name)