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
Byobu is a suite of enhancements to tmux, as a command line | |
tool providing live system status, dynamic window management, | |
and some convenient keybindings: | |
F1 * Used by X11 * | |
Shift-F1 Display this help | |
F2 Create a new window | |
Shift-F2 Create a horizontal split | |
Ctrl-F2 Create a vertical split | |
Ctrl-Shift-F2 Create a new session |
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
function * currentWeatherInSf () { | |
const { temperature } = yield new Promise( | |
resolve => setTimeout(() => resolve({ temperature: '5deg' }), 250) | |
) | |
return temperature | |
} | |
const weatherIterator = currentWeatherInSf() | |
const { value: fetchPromise } = weatherIterator.next() |
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
function pushBackIntoGeneratorExample * () { | |
const receivedValue = yield null | |
return receivedValue | |
} | |
const iteratorInstance = pushBackIntoGeneratorExample() | |
iteratorInstance.next('new value') // => { value: null, done: false } | |
iteratorInstance.next() // => { value: 'new value', done: true }! |
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
function * generatorFn () { | |
for (let i = 0; i < 5; i++) { | |
yield i | |
} | |
} | |
const iteratorInstance = generatorFn() | |
for (let value of iteratorInstance) { | |
console.log(value) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.0</real> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.0</real> |
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
const sum = (a, b, c) => a + b + c | |
const boundSum = sum.bind(null, 1, 2) | |
// console.log(boundSum(3)) => 6! |
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
const sum = (a, b, c) => a + b + c | |
const curriedSum = a => b => c => sum(a, b, c) | |
// sum(1, 2, 3) => 6 | |
// sum(1)(2)(3) => 6 |
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 { pluralize } from 'ember-inflector' | |
export function humanize (duration) { | |
const durationComponents = [ | |
{ value: duration.years(), unit: 'year' }, | |
{ value: duration.months(), unit: 'month' }, | |
{ value: duration.days(), unit: 'day' }, | |
{ value: duration.hours(), unit: 'hour' }, | |
{ value: duration.minutes(), unit: 'minute' }, | |
{ value: duration.seconds(), unit: 'second' }, |