Skip to content

Instantly share code, notes, and snippets.

View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
selectedIds: Ember.computed('signingPackages.@each.ids', function() {
var ids = [];
this.get('signingPackages').forEach(function(signingPackage) {
ids = ids.concat(signingPackage.get('ids'));
});
View components.signatory-select-list.js
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super();
},
filteredSignatories: Ember.computed('signatories.[]', function() {
return this.get('signatories').map((signatory) => {
var signatory = Ember.ObjectProxy.create({content: signatory});
View controllers.application.js
import Ember from 'ember';
const Object = Ember.Object;
const computed = Ember.computed;
var counter = 1;
const genres = [
Object.create({id: 1, label: 'learning'}),
Object.create({id: 2, label: 'fiction'}),
Object.create({id: 3, label: 'non-fiction'})
View controllers.application.js
import Ember from 'ember';
const Object = Ember.Object;
const computed = Ember.computed;
var counter = 1;
const genres = [
Object.create({id: 1, label: 'learning'}),
Object.create({id: 2, label: 'fiction'}),
Object.create({id: 3, label: 'non-fiction'})
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
filteredItems: Ember.computed('model.@each.legs.length', function() {
return this.get('model').filter(function(item) {
if(item.get('legs') >= 2) {
return item;
}
})
View kebase.md

Keybase proof

I hereby claim:

  • I am emerson on github.
  • I am emerson (https://keybase.io/emerson) on keybase.
  • I have a public key ASAZOcyWjU61HeiLF04Ox2ffn7uFqXPh2nG6oP0esJ_xZAo

To claim this, I am signing this object:

View components.one-way-input.js
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'input',
type: 'text',
attributeBindings: ['value'],
input(e) {
let val = this.readDOMAttr('value');
/*
* this.attrs.update(val)
@Emerson
Emerson / domain_assert
Last active Dec 8, 2015
Basic Response and Redirect Assertions in Bash
View domain_assert
#!/bin/bash
NC='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
function assert_success() {
request=`curl -s --head $1`
success=`grep "HTTP/1.1 200 OK" <<< "${request}"`
if [ -z "${success}" ]