Skip to content

Instantly share code, notes, and snippets.

import Component from '@glimmer/component';
export default class extends Component {
get items(){
return [1,2,3,4,5]
}
}
import Controller from '@ember/controller';
import {action} from '@ember/object';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
@action
handleClick(){
alert(this.routeParam);
}
@nighthawk457
nighthawk457 / deep-equals.js
Created April 4, 2017 15:33 — forked from rtm/deep-equals.js
JS deep equals
function deepEquals(x, y) {
if (x === y) return true;
if (x !== x) return y !== y;
if (typeof x !== typeof y) return false;
if (typeof x !== 'object') return false;
var typeX = getType(x);
var typeY = getType(y);
if (typeX !== typeY) return false;
@nighthawk457
nighthawk457 / tiny Promise.js
Created February 28, 2017 22:10 — forked from unscriptable/tiny Promise.js
A minimalist implementation of a javascript promise
// (c) copyright unscriptable.com / John Hann
// License MIT
// For more robust promises, see https://github.com/briancavalier/when.js.
function Promise () {
this._thens = [];
}
Promise.prototype = {
/**
* jQuery 2.1.3's parseHTML (without scripts options).
* Unlike jQuery, this returns a DocumentFragment, which is more convenient to insert into DOM.
* MIT license.
*
* If you only support Edge 13+ then try this:
function parseHTML(html, context) {
var t = (context || document).createElement('template');
t.innerHTML = html;
return t.content.cloneNode(true);
@nighthawk457
nighthawk457 / settings.json
Created February 18, 2017 18:45 — forked from abouthalf/settings.json
Visual Studio Code user settings for Operator Mono
// Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "Operator Mono SSm",
// Enables font ligatures
"editor.fontLigatures": true,
// Controls whether the editor should render whitespace characters
"editor.renderWhitespace": true
}