Skip to content

Instantly share code, notes, and snippets.

@tomdale
tomdale / gist:6382021
Created August 29, 2013 18:56
Ember inspector description
The Ember Inspector is a plug-in for the Chrome developer tools that makes understanding and debugging your Ember.js application a snap.
After installing this extension, you'll be able to easily:
- View all of the routes defined in your application.
- Reference Ember's naming conventions for your URLs, including what to name your controllers, templates, routes and more.
- Overlay your application with information about what templates, controllers, and models are currently being rendered.
- Inspect the objects in your application, such as models and controllers, with UI that fully supports Ember features such as bindings and computed properties.
- Make your application's objects available in the console as the $E variable.
@tomdale
tomdale / README.md
Created September 8, 2013 05:40 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.axis {
font: 10px sans-serif;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@tomdale
tomdale / gist:8176366
Last active January 1, 2016 17:19
House for Rent

Life-changing Room for Rent

Man, doesn't the San Francisco real estate market suck? Everything is tiny and expensive, and if you're new to the city, I bet you're feeling really overwhelmed.

But good news! Available for one lucky person is the opportunity to rent a room in a huge (by SF standards) house in Noe Valley with two of the most awesome housemates you could ask for.

@tomdale
tomdale / store.js
Created March 24, 2014 22:16
Microdata store
function buildRecord(type, data, store) {
var containerKey = 'model:' + type;
var factory = store.container.lookupFactory(containerKey);
var record = factory.create({
id: data.id,
$data: data
});

Keybase proof

I hereby claim:

  • I am tomdale on github.
  • I am tomdale (https://keybase.io/tomdale) on keybase.
  • I have a public key whose fingerprint is 2E8C 3BCE D5D0 939C 86AB 1B2E 2B57 2943 FC4D A5BF

To claim this, I am signing this object:

@tomdale
tomdale / local-storage-array.js
Created April 28, 2014 02:12
Ember Array that writes every change to localStorage
export default Ember.ArrayProxy.extend({
localStorageKey: null,
init: function() {
var localStorageKey = this.get('localStorageKey');
if (!localStorageKey) {
throw new Error("You must specify which property name should be used to save " + this + " in localStorage by setting its localStorageKey property.");
}
@tomdale
tomdale / format-date.js
Created April 30, 2014 21:19
Date Handlebars helper
// app/helpers/format-date.js
export default Ember.Handlebars.makeBoundHelper(function(value, options) {
if (!value) { return; }
options = options.hash;
var m = moment(value);
var now = moment();
/*!
handlebars v2.0.0-alpha.2
Copyright (C) 2011-2014 by Yehuda Katz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@tomdale
tomdale / logger.js
Last active August 29, 2015 14:02
Excerpt of the formatted, hierarchical logger in Skylight
/*
Example usage:
import logger from "app/system/logger";
var LOG = logger.loggerFor("topic"');
LOG.log({
event: "data received",
secondary: {
resource: "photo",