____
/ /\ \
| |
\_\_ tt rr rr eee aaaa mmmmm
\ \ ttttt rrrr ee ee aa aa mm m m
__/ / tt rr eee a a mm m m
|___/ tt rr eeee aaaaa mm m m
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
cnn.QueryMultiple<Table<Order>,Table<OrderLine>,Order>( | |
@"select * from Orders | |
select * from OrderLine", (orders, lines) => | |
{ | |
var map = lines.ToDictionary(line => line.OrderId); | |
foreach(var order in orders) | |
{ | |
order.Lines = map[order.Id]; | |
yield return order; | |
} |
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
public class QueryOverStub<TRoot, TSub> : IQueryOver<TRoot, TSub> | |
{ | |
private readonly TRoot _singleOrDefault; | |
private readonly IList<TRoot> _list; | |
private readonly ICriteria _root = MockRepository.GenerateStub<ICriteria>(); | |
public QueryOverStub(IList<TRoot> list) | |
{ | |
_list = list; | |
} |
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
// So this is short and easier | |
process.stdin.resume() | |
process.stdin.on('data', function(data) { process.stdout.write(data) }) | |
process.stdout.on('error', function(err) { | |
if (err.code === 'EPIPE') return process.exit() | |
process.emit('error', err) | |
}) |
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
#!/bin/bash | |
lastCommit="" | |
editorCmd="sed -i ''" | |
for commit in $@; do | |
lastCommit=${commit:0:7} | |
editorCmd="$editorCmd -e 's/pick ${lastCommit}/fixup ${lastCommit}/'" | |
done | |
GIT_SEQUENCE_EDITOR=$editorCmd git rebase -i ${lastCommit}~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
(curl https://raw.github.com/bnoordhuis/node-profiler/master/tools/nprof-stub.js; \ | |
for file in splaytree codemap csvparser consarray profile profile_view logreader tickprocessor tickprocessor-driver; \ | |
do curl https://raw.github.com/joyent/node/$(node --version)/deps/v8/tools/$file.js; \ | |
done) > nprof && chmod +x nprof |
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
var fs = require('fs'), | |
Trunc = require('truncating-stream'), | |
truncStream = new Trunc({limit: 10}), | |
readStream = fs.createReadStream('/dev/random') | |
readStream.on('end', function() { console.log('readStream ended') }) | |
readStream.on('close', function() { console.log('readStream closed') }) | |
readStream.pipe(truncStream).pipe(process.stdout) |
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
$ npm outdated -g | |
npm http GET https://registry.npmjs.org/c-pm | |
npm http GET https://registry.npmjs.org/bugger | |
npm http GET https://registry.npmjs.org/buffet | |
npm http GET https://registry.npmjs.org/coffee-script | |
npm http GET https://registry.npmjs.org/froth | |
npm http GET https://registry.npmjs.org/ecstatic | |
npm http GET https://registry.npmjs.org/gh | |
npm http GET https://registry.npmjs.org/jshint | |
npm http GET https://registry.npmjs.org/express |
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
React = require 'react' | |
{ul, li, div, h3, button, form, input} = React.DOM | |
TodoApp = React.createClass | |
getInitialState: -> | |
items: @props.items | |
text: '' |
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
var util = require('util') | |
var Readable = require('stream').Readable | |
var request = require('request') | |
var async = require('async') | |
function PagingFetchStream(opts) { | |
Readable.call(this, {objectMode: true}) | |
opts = opts || {} | |
this.getIdsUrl = opts.getIdsUrl |
OlderNewer