Skip to content

Instantly share code, notes, and snippets.

View runspired's full-sized avatar
💜
Pondering Paradigms

Chris Thoburn runspired

💜
Pondering Paradigms
View GitHub Profile
/**
* Module requirements.
*/
var XMLHttpRequest = require('xmlhttprequest');
var Polling = require('./polling');
var Emitter = require('component-emitter');
var inherit = require('component-inherit');
var debug = require('debug')('engine.io-client:polling-xhr');
function makeCSP(CSP, domains) {
domains.forEach(function(o) {
var domain = makeDomain(o);
domain.sources.forEach(function(source) {
var parts = appendSubdomains(domain.subdomains, domain.domain);
parts = appendProtocols(parts, domain.protocols);
parts = appendPorts(parts, domain.ports);
CSP[source] += ' ' + parts.join(' ');
@runspired
runspired / ember-recipes.md
Last active August 11, 2016 02:46
ember-recipes

#Ember Recipes

Recipes should be tested.

  • Having tested recipes helps make ensure they still work with new versions of Ember.
  • It helps document how you should test a feature in your app.
  • It would enable us (or someone else) to build walk through test-driven tutorials for common Ember patterns and needs.

Recipes should be self-documenting

@runspired
runspired / controllers.application.js
Created August 12, 2015 18:52
Stopping Propagation
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
outer() {
alert('outer');
},
@runspired
runspired / controllers.application.js
Created August 13, 2015 21:48
Input Listener Patterns
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
awesome: function() {
alert("awesome");
}
}
@runspired
runspired / CurrentSetup.md
Last active January 18, 2016 15:49
Using Pods in Ember
adapters/
  foo.js
  
models/
  foo.js
  
serializers/
  foo.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Notifying a property change on a property passed into a child component',
description: 'There is a parent component with some buttons. When a user clicks on a button, the buttons\'s action changes the property. Since the changed property is passed into the wrapped component, you would expect that it\'s observer would fire also. But it does not. To try this, just type in 1233 and you will see that the last 3 will not render.'
});
@runspired
runspired / application.controller.js
Created November 4, 2015 01:50 — forked from Asherlc/application.controller.js
Association Computation
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
addWord: function() {
var word = this.store.createRecord('word', {
});
this.get('model.pages.firstObject.words')
@runspired
runspired / leak.js
Created November 5, 2015 06:35
ES6 Fat Arrow ( => ) functions can cause memory leaks when used with Event Handlers.
class Foo {
constructor(element) {
this.element = element;
this.setupHandlers();
}
doFoo() {}
setupHandlers() {
@runspired
runspired / application.controller.js
Last active September 17, 2016 06:29
Event Complexities
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});