This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function insertScript(src) { | |
var scripts = document.getElementsByTagName('script'); | |
var newScript = document.createElement('script'); | |
newScript.src = src; | |
scripts[0].parentNode.insertBefore(newScript, scripts[0]); | |
} | |
// This is contrived. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import config from './config/environment'; | |
const Router = Ember.Router.extend({ | |
location: 'none', | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route('products', function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
queryParams: ['something'], | |
filter: null, | |
actions: { | |
reloadList() { | |
this.transitionToRoute('list.details', { queryParams: { filter: 'hello' } }); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
value: { | |
id: 12, | |
name: 'james' | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
queryParams: ['category', 'term'], | |
category: 0, | |
term: 0, | |
actions: { | |
increment(qp) { | |
let routeArgument = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
function makeIterable(someObject) { | |
someObject[Symbol.iterator] = function() { | |
let nextIndex = 0; | |
return { | |
next: function() { | |
if (nextIndex < someObject.order.length) { | |
return { value: someObject[someObject.order[nextIndex++]], done: false }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* You can navigate the Facebook feed interface using `j` and `k`. | |
* This script allows you to use the `x` key once focused on a story | |
* to hide a post and see less from its author to train Facebook's model | |
* as to whether you'll be interested in a particular piece of content. | |
* Install it as either a UserScript or bookmarklet. | |
* | |
* License: MIT | |
*/ | |
function seeLess() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import config from './config/environment'; | |
const Router = Ember.Router.extend({ | |
location: config.locationType, | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route('standalone'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import config from './config/environment'; | |
const Router = Ember.Router.extend({ | |
location: config.locationType, | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route('standalone'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
let i = 0; | |
export default Ember.Controller.extend({ | |
foo: function(event) { | |
console.log(++i, this, event); | |
}, | |
actions: { | |
thing: function(event) { |