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
import Ember from 'ember';
export default Ember.Route.extend({
init() {
this._super(...arguments);
$.mockjax({
url: '/users',
responseText: {
users: [{
import Ember from 'ember';
const {
Controller,
computed,
get,
set,
RSVP,
ArrayProxy,
PromiseProxyMixin,
@runspired
runspired / application.controller.js
Last active January 6, 2016 18:16 — forked from denzo/application.controller.js
Computed Properties with @each
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
owner: Ember.computed(function() {
return this.store.createRecord('owner');
}),
cleanItems: Ember.computed('[email protected]',function() {
@runspired
runspired / application.controller.js
Created January 6, 2016 17:37
PromiseHasMany Replication
import Ember from 'ember';
const {
Controller,
computed,
get,
set,
RSVP,
ArrayProxy,
PromiseProxyMixin,
@runspired
runspired / application.controller.js
Created January 11, 2016 11:22 — forked from miguelcobain/application.controller.js
didReceiveAttrs array changes
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
items: [
'Item 1',
'Item 2',
'Item 3',
'Item 4'
],
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
time: new Date(),
showYield: false,
actions: {
updateTime() {
@runspired
runspired / named-yields.md
Last active April 21, 2023 17:14
Some thoughts I had on named yeilds

Ember Named Yields

Current Idea

The current thinking floating around for named yields looks something like this. You can't mix use of named blocks and non-blocked content. Once you use a block helper within a component, everything, including your main yield needs to be within one. If you don't use one, then your yielded content is the main block. This gist is a suggestion I have for how named yields should be implemented and work, and follows the evolution of my thinking on it.

const EVENT_DEFAULTS = {
bubbles: true
};
export default triggerEvent(element, name, options) {
const eventInit = Object.assign({}, EVENT_DEFAULTS, getLocation(element), options);
const event = new getConstructor(name)(name, eventInit);
element.dispatchEvent(event);
}
@runspired
runspired / .bash_profile
Last active February 6, 2023 14:56
Make Alfred / Spotlight ignore node_modules and bower_components
alias nom='npm cache clean && rm -rf node_modules && mkdir node_modules && touch node_modules/.metadata_never_index && npm install'
alias bom='bower cache clean && rm -rf bower_components && mkdir bower_components && touch bower_components/.metadata_never_index && bower install'
<screen> <!-- not flex -->
<container horiztonal> <!-- flex column
<vbox></vbox> <!-- 100% height, some width -->
<hbox> <!-- remaining width -->
<container vertical> <!-- 100% width -->
<!-- the items split the available height -->
<box>
<container horizontal> <!-- 100% width -->
<!-- the items split the available width -->
<box></box>