This file contains hidden or 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
| """ | |
| Non blocking example: | |
| 1. Browse to `localhost:8000/sleep1` | |
| 2. Browse to `localhost:8000/` | |
| You'll observe that the first call will take 5 seconds and the second call will be executed immediately. | |
| Blocking example: | |
| 1. Browse to `localhost:8000/sleep2` | |
| 2. Browse to `localhost:8000/` |
This file contains hidden or 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
| // I did this in Chrome... | |
| // | |
| // Go to https://www.facebook.com/ads/preferences/ | |
| // Click the "Advertisers" section to open it up. | |
| // Click "See more" once | |
| // Before doing anything else, just keep clicking space bar to trigger the "see more" button | |
| // Do this for a bit until all the advertisers are loaded | |
| // then run this below in the dev tools console... | |
| // (It will take a few minutes, depending how many you have, and your browser may lock up, but once it's done you will see it auto clicked the "remove" X in the top right for all of them) |
This file contains hidden or 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 { inject as service } from '@ember/service'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| notifier: service(), | |
| actions: { | |
| launch() { | |
| const options = { duration: 0 }; |
This file contains hidden or 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 DS from 'ember-data'; | |
| export default DS.JSONAPIAdapter.extend({ | |
| namespace: 'api' | |
| }); |
This file contains hidden or 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 DS from 'ember-data'; | |
| export default DS.RESTAdapter.extend({ | |
| shouldBackgroundReloadRecord() { return false; } | |
| }); |
This file contains hidden or 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 { groupByPath } from 'ember-cli-group-by/macros'; | |
| const { | |
| computed: { alias }, | |
| } = Ember; | |
| export default Ember.Controller.extend({ | |
| user: alias('model'), | |
| cart: alias('user.cart'), |
This file contains hidden or 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({ | |
| appName: 'Ember Twiddle', | |
| data: [ | |
| { label: 'language', name: 'Python' }, | |
| { label: 'language', name: 'JavaScript' }, | |
| { label: 'web', name: 'Django' }, | |
| { label: 'web', name: 'Flask' }, |
This file contains hidden or 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.Component.extend({ | |
| store: Ember.inject.service(), | |
| selected: null, | |
| types: [], | |
| loadTypes: Ember.on('didInsertElement', function () { | |
| this.get('store').findAll('type') |
This file contains hidden or 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({ | |
| appName: 'Ember Twiddle' | |
| }); |
This file contains hidden or 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'; | |
| const skills = ['Python', 'Javascript', 'Django'] | |
| export default Ember.Controller.extend({ | |
| skill: null, | |
| skillSource: function(query, syncResults, asyncResults) { | |
| const regex = new RegExp('.*' + query + '.*', 'i'); | |
| const results = skills.filter((item, index, enumerable) => { | |
| return regex.test(item); |
NewerOlder