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: ['foo'], | |
foo: '' | |
}); |
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({ | |
appName: 'Ember Twiddle' | |
}); |
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 moduleForAcceptance from '../helpers/module-for-acceptance'; | |
import sinon from 'sinon'; | |
const { Test } = Ember; | |
moduleForAcceptance('Acceptance | error', { | |
beforeEach() { | |
this.sandbox = sinon.sandbox.create(); |
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.Component.extend({ | |
foo: '', | |
init() { | |
this._super(...arguments); | |
console.info(this.constructor, 'init', this.getProperties('foo', 'attrs.foo.value')); | |
}, |
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
# Usage: `griot fucking ridiculous` | |
function griot() { | |
lynx "http://rapgenius.com/search?q=`echo $@ | perl -p -e 's/\s+/+/g'`"; | |
} |
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
npm version patch | parallel -I % git tag % %^{} -f -a |
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
class A | |
class B extends Serializable | |
val baos = new java.io.ByteArrayOutputStream(1024) | |
val oos = new java.io.ObjectOutputStream(baos) | |
val streamSurprise: Seq[A] = Stream.fill(3)(new A) // say you don't know it's a Stream under the covers | |
val transformation = streamSurprise map (a => new B) | |
oos.writeObject(transformation) // fails due to NotSerializableException: A |
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
#!/bin/zsh | |
ls > foo.txt | |
ls | parallel -j 1 'ls {}/**/*.* | wc -l' > bar.txt | |
paste foo.txt bar.txt | sort -t "<TAB>" -k2 -n # <TAB> = Ctrl+V, Tab |
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
def evenNumber(n: Int) = if (n % 2 == 0) Some(n) else None | |
// an example for-comprehension … | |
for { | |
num <- List(1, 2, 3) | |
evenNum <- evenNumber(num) | |
} yield evenNum | |
// … which desugars to … | |
List(1, 2, 3) flatMap (evenNumber) |
NewerOlder