Skip to content

Instantly share code, notes, and snippets.

tomdale / store.js
Created Mar 24, 2014
Microdata store
View store.js
function buildRecord(type, data, store) {
var containerKey = 'model:' + type;
var factory = store.container.lookupFactory(containerKey);
var record = factory.create({
$data: data

Keybase proof

I hereby claim:

  • I am tomdale on github.
  • I am 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:

View handlebars-hax.js
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 / logger.js
Last active Aug 29, 2015
Excerpt of the formatted, hierarchical logger in Skylight
View logger.js
Example usage:
import logger from "app/system/logger";
var LOG = logger.loggerFor("topic"');
event: "data received",
secondary: {
resource: "photo",
tomdale / test.js
Created Jul 15, 2014
Example component test from Skylight
View test.js
// from
import Ember from "ember";
import { test, moduleForComponent } from 'ember-qunit';
import Util from "app/system/util";
var run =;
moduleForComponent("billing-trial-status", "billing-trial-status component", {
needs: [
tomdale / gist:7d17530c12dbc104b15d
Created Nov 15, 2014
destructuring assignment example
View gist:7d17530c12dbc104b15d
// before
var displayAnnotation = config.displayAnnotation,
width = config.width,
axisHeight = config.axisHeight,
barsLeftMargin = config.barsLeftMargin,
barsRightMargin = config.barsRightMargin;
// after
var { displayAnnotation,
tomdale / gist:ad71ff9bf1227b687510
Created Jun 5, 2015
Shell function to start IR Hydra
View gist:ad71ff9bf1227b687510
irhydra () {
cd ~/irhydra
command rm -f *.cfg *.asm
command "/Applications/Google Chrome Chrome Canary" --no-sandbox \
--js-flags="--trace-hydrogen \
--trace-phase=Z \
--trace-deopt \
--code-comments \
--hydrogen-track-positions \
View Currencyconverter.converterController
// ==========================================================================
// Project: Currencyconverter.converterController
// Copyright: ©2009 My Company, Inc.
// ==========================================================================
/*globals Currencyconverter */
/** @class
Converts one form of currency to another.
View gist:337732
// dynamically apply a mixin specified in an object property
var MyClass = SC.Object.extend({
extraMixin: null,
foo: "bar",
init: function() {
arguments.callee.base.apply(this, arguments);
tomdale / gist:938930
Created Apr 23, 2011
How to override a label view render delegate
View gist:938930
layout: { centerX: 0, centerY: 0, width: 200, height: 18 },
tagName: "h1",
value: "Welcome to SproutCore!",
// Adds 'didClick' as a display property
displayProperties: ['didClick'],
didClick: NO,