Skip to content

Instantly share code, notes, and snippets.

@mariechatfield
mariechatfield / Sk.abstr.typeName
Last active December 20, 2015 18:48
Clean up Sk.misceval.richCompareBool and make behave like Python when comparing objects of different built-in types. Also improve error messages when attempting to compare invalid types.
Sk.abstr.typeName = function(v) {
var vtypename;
if (v instanceof Sk.builtin.nmber) {
vtypename = v.skType;
} else if (v.tp$name !== undefined) {
vtypename = v.tp$name;
} else {
vtypename = "<invalid type>";
};
return vtypename;
@mariechatfield
mariechatfield / dominos.svg
Created April 13, 2017 00:17
Domino Tiles
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import Ember from 'ember';
// This component manages interaction with the location service, and wraps
// around the location-filter/location-dropdown component, which handles
// all the logic/UI of the actual picker
export default Ember.Component.extend({
location: Ember.inject.service(),
// Get all state from the service directly. Mark as readOnly to prevent
// accidental writes to service state.
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
log(name) {
this.sendAction('log', name);
}
}
});
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
log(name) {
this.sendAction('log', name);
}
}
});
@mariechatfield
mariechatfield / application.hbs
Last active August 6, 2017 00:22
Ember Events: Element Modifier
<div class="element-modifier" {{action "handleClick"}}></div>
@mariechatfield
mariechatfield / application.hbs
Last active August 6, 2017 00:25
Ember Events: click Component Attribute
{{some-component class="click-attribute" click=(action "handleClick")}}
@mariechatfield
mariechatfield / application.hbs
Last active August 6, 2017 00:27
Ember Events: onClick HTML Attribute
<div class="onclick-attribute" onclick={{action "handleClick"}}></div>
@mariechatfield
mariechatfield / events_actions_flowchart_caption.txt
Last active August 6, 2017 02:21
Caption for Flowchart: How do events and actions work in Ember?
Title of Chart: How do events and actions work in Ember?
Top of Chart
Step 1. Something happens! A DOM event is born.
- Proceed to Section A: DOM Events, Step 2: Event is triggered on node.
Section A
Title: DOM Events
Description: This logic is implemented by the browser and uses standard DOM events.