Skip to content

Instantly share code, notes, and snippets.

View DingoEatingFuzz's full-sized avatar
💻
As you already know, computers

Michael Lange DingoEatingFuzz

💻
As you already know, computers
View GitHub Profile
# List new merges since the last tag
whatsnew = "!git log --merges --oneline $(git describe --tags --abbrev=0).."
@DingoEatingFuzz
DingoEatingFuzz / chai-noisy-arrays.js
Created May 10, 2016 21:18
Chai formatArray when Array.prototype has been modified.
const expect = require('chai').expect;
Array.prototype.doubleAll = function() {
return this.map(a => a * 2);
};
describe("Arrays", function() {
describe("doubleAll method", function() {
it("should exist on all arrays", function() {
expect([].doubleAll).to.be.instanceof(Function);
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
noChange: function() {
return 'foo';
}.property(),
butWhy: function() {
@DingoEatingFuzz
DingoEatingFuzz / components.checkbox-input.js
Last active October 8, 2016 03:42
ember-1.13-over-rendering
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'input',
type: 'checkbox',
attributeBindings: [ 'type', 'name', 'checked:checked' ],
change: function() {
this.sendAction('onChange', this.get('name'), this.$().is(':checked'));
@DingoEatingFuzz
DingoEatingFuzz / qwerty-graph
Created October 14, 2016 02:53
A graph of each letter's neighbors on a qwerty keyboard.
a qwsz
b vghn
c xdfv
d serfcx
e wsdr
f drtgvc
g ftyhbv
h gyujnb
i ujko
j huikmn
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@DingoEatingFuzz
DingoEatingFuzz / controllers.application.js
Created April 13, 2017 20:22
Tours Data Structure Proposal
import Ember from 'ember';
import Tour from '../tour-model';
const { inject } = Ember;
export default Ember.Controller.extend({
personalization: inject.service(),
campaignTour: null,
@DingoEatingFuzz
DingoEatingFuzz / controllers.application.js
Created July 20, 2017 17:16
Computed Property Caching
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
defaultItem: 'foo',
item: Ember.computed(function() {
return this.get('defaultItem')
}),
import Ember from 'ember';
export default Ember.Component.extend({
items: [],
actions: {
addItem(item) {
this.get('items').pushObject(item);
},
}
@DingoEatingFuzz
DingoEatingFuzz / ed-duplicate-id.md
Last active April 4, 2018 18:39
Ember Data duplicate record in hasMany bug report

Duplicate Records make it into the store

This occurs in Nomad UI, an open source ember app: https://github.com/hashicorp/nomad/tree/master/ui

Summary

Fetching related data in the right order under unknown circumstances will push a copy of an existing record instead of updating the existing record.

Steps to Reproduce