Skip to content

Instantly share code, notes, and snippets.

View jeffreybiles's full-sized avatar

Jeffrey Biles jeffreybiles

View GitHub Profile
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
var myArray = ['he','name','of','very','to','through','and','just','a','form','in','much','is','great','it','think','you','say','that','help','he','low','was','line','for','before','on','turn','are','cause','with','same','as','mean','I','differ','his','move','they','right','be','boy','at','old','one','too','have','does','this','tell','from','sentence','or','set','had','three','by','want','hot','air','but','well','some','also','what','play','there','small','we','end','can','put','out','home','other','read','were','hand','all','port','your','large','when','spell','up','add','use','even','word','land','how','here','said','must','an','big','each','high','she','such','which','follow','do','act','their','why','time','ask','if','men','will','change','way','went','about','light','many','kind','then','off','them','need','would','house','write','picture','like','try','so','us','these','again','her','animal','long','point','make','mother','thing','world','see','near','him','build','two','self
@jeffreybiles
jeffreybiles / components.validated-field.js
Created August 11, 2016 20:29 — forked from poteto/controllers.application.js
ember-changeset-validations demo
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
validateProperty(changeset, property){
return changeset.validate(property);
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@jeffreybiles
jeffreybiles / computed_properties.md
Created October 30, 2015 00:50 — forked from danielchappell/computed_properties.md
Computed Properties Best Practices

Computed Property Theory & Best Practices or Functional Programming in Ember or How I learned to stop worrying and love the Tomster.

In a nutshell, computed properties let you declare functions as properties. You create one by defining a computed property as a function, which Ember will automatically call when you ask for the property. You can then use it the same way you would any normal, static property. -- The Ember Guides

The Ember Object Model is the corner stone of Ember, and at the heart of the Object Model are computed properties.

The guides do a fine job giving need to know information on how to create and use computed properties and what to expect from the cacheing system they provide. However, I feel so much of the beauty that computed properties provide is lost in terse (but wonderful) documentation.

Quick..the basics!

@jeffreybiles
jeffreybiles / gist:53308b32db5abf5db412
Created April 7, 2015 22:11
hacky way to count number of CSS rules
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
var totalCount = 0
for (var i = 0; i < document.styleSheets.length; i++) {
totalCount += countSheet(document.styleSheets[i]);
var square;
square = function(x) {
return x * x;
};
square = (x) -> x * x
var x;
x = 5;