Skip to content

Instantly share code, notes, and snippets.

@EvanOxfeld
EvanOxfeld / package.json
Created August 8, 2014 16:14
Browserify package.json with Angular & napa experiment
{
"name": "todo-angular-browserify",
"version": "0.0.0",
"description": "",
"main": "bundle.js",
"dependencies": {},
"devDependencies": {
"browserify": "^4.2.3",
"browserify-shim": "^3.6.0",
"napa": "^0.4.1"
@EvanOxfeld
EvanOxfeld / highWater.js
Last active December 15, 2015 02:19
Attempt at a reduced test case for EvanOxfeld/node-unzip#20
var test = require('tap').test;
var PassThrough = require('stream').PassThrough;
var path = require('path')
var fs = require('fs');
var zlib = require('zlib');
var PullStream = require('pullstream');
var loremString = 'ΩΩLorem ipsum dolor sit amet, consectetur adipiscing el' +
'it. Morbi faucibus, purus at gravida dictum, libero arcu convallis la' +
'cus, in commodo libero metus eu nisi. Nullam commodo, neque nec porta' +
@EvanOxfeld
EvanOxfeld / until-stream.md
Last active October 13, 2017 17:42
A node.js stream that stops piping when a pattern is reached

The new nodejs Streams2 API is great at buffering, handles back-pressure for you in many cases, and exposes a nice read() method that allows reading a fixed length number of bytes. However, if you'd like to read from a stream or pipe a stream into a destination stream until a pattern, you're back to some level of rolling your own buffering and back-pressure support. UntilStream aims to solve both use cases.

Examples below, more details can be found on EvanOxfeld/until-stream.

Quick Examples

Pipe to a destination stream until the pattern is reached

UntilStream unpipes and ends the destination stream when the pattern is reached. The next call to read() returns exactly the pattern. Back-pressure is handled for you.

@EvanOxfeld
EvanOxfeld / .gitconfig
Last active October 12, 2015 16:37
Git config
[user]
name = Evan Oxfeld
email = eoxfeld@gmail.com
[color]
diff = auto
status = auto
branch = auto
ui = true
[alias]
@EvanOxfeld
EvanOxfeld / gist:3182265
Created July 26, 2012 14:10
node-tar test results on OS X Lion using node v0.8.4
~/Dev/node-tar (master ✔) ᐅ npm test
> tar@0.1.13 test /Users/eoxfeld/Dev/node-tar
> tap test/*.js
ok test/00-setup-fixtures.js ............................ 4/4
ok test/extract.js .................................... 44/44
ok test/header.js ..................................... 22/22
not ok test/pack-no-proprietary.js ..................... 9/11
Command: "node" "pack-no-proprietary.js"
@EvanOxfeld
EvanOxfeld / _nit
Created May 23, 2012 20:45
Nit completion plugin for Oh My ZSH
#compdef nit
#autoload
# Node Issue Tracker
# https://github.com/nearinfinity/node-nit
_assigned_to_me_nits() {
assigned_to_me_nits=(`nit list -o | awk '/Assigned to me/ {for(i=1; i<=NF; i++) {getline; print $1}}'`)
}