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', | |
children: Ember.computed('model.children', function() { | |
return this.get('model.children'); | |
}) | |
}); |
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 CachedRouter, { time } from 'cacheable-router'; | |
import blacklist from './config/sku-blacklist'; | |
import products from './api/products'; | |
const router = new CachedRouter(express.Router(), { | |
adapter: 'redis', | |
adapterOptions: { | |
port: process.env.REDIS_PORT, | |
hostname: process.env.REDIS_HOSTNAME, | |
password: process.env.REDIS_PASSWORD |
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({ | |
hasFocus: false, | |
options: [ | |
{ | |
name: 'Foo', | |
value: 'http://foo.com' | |
}, | |
{ |
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 class extends Ember.Controller { | |
get appName() { return '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'; | |
export default Ember.Component.extend({ | |
}); |
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
let format = new Intl.DateFormat('en-US', { | |
hour: 'numeric', minute: 'numeric', second: 'numeric', | |
timeZoneName: 'short' | |
}); | |
const { computed, run } = Ember; | |
const COUNTERS = '__COUNTERS__'; | |
let idx = 0; | |
export default function({ interval }) { |
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
#!/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" |
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
export default Service.extend({ | |
i18n: service(), | |
init() { | |
this._super(...arguments); | |
this._subscribers = A(); | |
this.subscribe((e) => logger.error(e), this); | |
} |
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
Router.map({ | |
needs: ['i18n'] | |
}, function({ i18n }) { | |
this.route('index', { path: '/' }); | |
this.route('about', { path: i18n.t('urls.about') }); | |
this.route('contact_us', { path: i18n.t('urls.contact_us') }); | |
}); |
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
// Also, parts of this are entirely wrong.. I don't have access to what | |
// I originally wrote at the moment but it at least shows roughly the idea.. | |
import Ember from 'Ember'; | |
const { get, Logger } = Ember; | |
export default { | |
name: 'router-map-patch', | |
initialize() { | |
Ember.Router.reopen({ |