Skip to content

Instantly share code, notes, and snippets.

View gitjeff05's full-sized avatar

Jeff Laiosa gitjeff05

View GitHub Profile
@gitjeff05
gitjeff05 / remove_cell_outputs.sh
Last active March 16, 2020 19:38
Remove cell outputs and execution_count with the addition/merge operator in jq
local FILE
FILE=${1}
jq -r --indent 1 '. + { "cells": .cells
| map(. +
(if .cell_type == "code" then { "outputs": [], "execution_count": null } else {} end)
) }' "${FILE}"
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember.get() vs this.get() vs object.property',
emObj: null,
pojo: {
y: {
m: 'pojo'
}
},
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.'
});
@gitjeff05
gitjeff05 / components.some-component.js
Last active August 29, 2015 14:27
Component Rendering Hooks
import Ember from 'ember';
export default Ember.Component.extend({
someCondition: false,
componentName: 'some-component',
changeCondition: function() {
console.log(this.get('componentName') + ' on did insert element');
setTimeout(() => {
this.set('someCondition', true);
@gitjeff05
gitjeff05 / components.user-profile.js
Last active August 29, 2015 14:25
Ember Promises and Runloop
import Ember from 'ember';
export default Ember.Component.extend({
needs: ['users'],
moods: [],
name: Ember.computed.reads('user.name'),
userId: Ember.computed.reads('user.userId'),
showInfo: false,
status: Ember.computed.mapBy('moods', 'status'),
isLoading: false,