Skip to content

Instantly share code, notes, and snippets.

View scottmessinger's full-sized avatar

Scott Ames-Messinger scottmessinger

View GitHub Profile
@scottmessinger
scottmessinger / process.rb
Created July 15, 2015 18:45
Importer with Transproc
preprocessor = Preprocessor.build
processor = Processor.build
evaluator = InputFunctions[:eval_values, [{ 'jd' => 'jd001' }]]
create_authors_with_books = rom.command([
:authors, [:create, [:books, [:create]]]
])
@scottmessinger
scottmessinger / enhancers.index.js
Last active February 8, 2017 22:35 — forked from toranb/helpers.average.js
New Twiddle
import { compose } from 'redux';
var devtools = window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f;
var composed = compose(devtools);
window.__REDUX_DEVTOOLS_EXTENSION__.open();
export default composed
@scottmessinger
scottmessinger / components.a-child.js
Last active October 6, 2016 22:36
Rerender entire tree
import Ember from 'ember';
export default Ember.Component.extend({
didReceiveAttrs(){
this._super(...arguments)
console.log('didReceiveAttrs', 'a-child')
}
});
@scottmessinger
scottmessinger / components.my-child.js
Last active October 6, 2016 21:54
playing with immutable.js
import Ember from 'ember';
export default Ember.Component.extend({
didReceiveAttrs(){
this._super(...arguments)
console.log('didReceiveAttrs', 'my-child')
}
});
import Ember from 'ember';
export default Ember.Component.extend({
didRender(){
console.log('didRender expensive-outline-item.hbs')
}
});
(function (lib, img, cjs, ss) {
var p; // shortcut to reference prototypes
// library properties:
lib.properties = {
width: 1000,
height: 1000,
fps: 24,
color: "#FFFFFF",
@scottmessinger
scottmessinger / html
Last active December 25, 2015 02:28
Uservoice
var uvOptions = {};
// Include the UserVoice JavaScript SDK (only needed once on a page)
(function(){var uv=document.createElement('script');uv.type='text/javascript';uv.async=true;uv.src='//widget.uservoice.com/API_KEY.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(uv,s)})()
UserVoice=window.UserVoice||[];
function showClassicWidget() {
UserVoice.push(['showLightbox', 'classic_widget', {
primary_color: '#cc6d00',
link_color: '#007dbf',
forum_id: 140171
}]);
var smoke = TS.HomeSmokeView.create({signal: "Magically Generating Your Schedule. Hold on.<br>Magic can't be rushed."}).append()
Ember.run.schedule('afterRender', this, function(){
this.get('queue').forEach(function(course) {
course.schedule()
})
this.get('queue').clear()
smoke.destroy()
})

Core Concepts

[ snip ]

Concepts

The router drives an Ember app. The router translates the URL into a model that is rendered with a template. Optionally, you can use controllers and views for more control. Controllers hold application state that isn't expressed in the URL. Views back templates and can handle events.

Templates

[ snip ]

Models

<div class="selected-standards">
<ul>
{{#each selected in view.context.standards}}
<li class="box selected-triad">
<span {{ action toggleStandard selected view target="view.context"}}> {{selected.shortCode}} </span>
</li>
{{/each}}
</ul>
</div>