Skip to content

Instantly share code, notes, and snippets.

@tomdale
tomdale / test.js
Created July 15, 2014 01:54
Example component test from Skylight
// 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 / 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",
/*!
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 / 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();
@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.");
}

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 / 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
});
@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.

<!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 / README.md
Created September 8, 2013 05:40 — forked from mbostock/.block