Skip to content

Instantly share code, notes, and snippets.

Tom Dale tomdale

Block or report user

Report or block tomdale

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tomdale
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({
id: data.id,
$data: data
});
View keybase.md

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:

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
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"');
LOG.log({
event: "data received",
secondary: {
resource: "photo",
@tomdale
tomdale / test.js
Created Jul 15, 2014
Example component test from Skylight
View test.js
// from https://www.skylight.io
import Ember from "ember";
import { test, moduleForComponent } from 'ember-qunit';
import Util from "app/system/util";
var run = Ember.run;
moduleForComponent("billing-trial-status", "billing-trial-status component", {
needs: [
@tomdale
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
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 Canary.app/Contents/MacOS/Google Chrome Canary" --no-sandbox \
--js-flags="--trace-hydrogen \
--trace-phase=Z \
--trace-deopt \
--code-comments \
--hydrogen-track-positions \
--redirect-code-traces"
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() {
this.mixin(this.extraMixin);
arguments.callee.base.apply(this, arguments);
},
@tomdale
tomdale / gist:938930
Created Apr 23, 2011
How to override a label view render delegate
View gist:938930
labelView: SC.LabelView.design({
layout: { centerX: 0, centerY: 0, width: 200, height: 18 },
textAlign: SC.ALIGN_CENTER,
tagName: "h1",
value: "Welcome to SproutCore!",
// Adds 'didClick' as a display property
displayProperties: ['didClick'],
didClick: NO,
You can’t perform that action at this time.