Skip to content

Instantly share code, notes, and snippets.

View thlorenz's full-sized avatar
👁️
{ this.props.status }

Thorsten Lorenz thlorenz

👁️
{ this.props.status }
View GitHub Profile
@thlorenz
thlorenz / ErrorOutput-WithSomeProcessingOutputOnTop.txt
Created July 18, 2013 17:48
Outlines problems with leveldb piping data through transform and back into level
processing "/zanzibar/seeanddo" total 7 urls
processing "/zurich/hotels" total 9 urls
processing "/zurich/restaurants" total 8 urls
processing "/zurich/seeanddo" total 1 urls
transformed url db read value stream ended
raw html write db stream closed
database now contains raw html content for 15716 urls
transformed: /zurich/hotels/504749 to html with content length 6759
[Error: stream.push() after EOF]
Error: stream.push() after EOF
@thlorenz
thlorenz / https.js
Last active December 20, 2015 01:08
HEAD request using https and hyperquest
// The below works, although having to call res.on('data') is not ideal
var https = require('https');
var opts = {
hostname : 'github.com'
, path : '/substack/hyperquest'
, method : 'GET'
}
@thlorenz
thlorenz / kindofastack
Last active December 20, 2015 03:59
testling@1.3.2 error stacktrace
➝ testling
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
@thlorenz
thlorenz / SiriNotes.md
Last active December 20, 2015 22:48
CascaciaJS 2013 talk ideas

This talk is to make What developers and no GS server people reevaluated their workflow and the tools are using in order to dramatically increase the gproductivity Minimize context switches, stating better, use the Reppel to inspect the libraries you're tusing Siri using them Ability to run the scripts that the competitor in the ones for the browser

The talk is not talked about a particular tool and said it would just demonstrate how to use this tool in order to achieve maximum productivity

A major ingredient for making building web applications no just so much fun is the short Fitbit you and hyperactivity however people have gotten used to the level of productivity they haven't actually use the footwork

After the talk people should just be excited about going out there and finding your tools or reevaluating what their credentials can do for them they want to work before

@thlorenz
thlorenz / hooks.js
Created August 15, 2013 12:57
Using hooker to inject logs about events and/or http server responses
// npm install hooker
var hooker = require('hooker');
function hookEmitter () {
var EventEmitter = require('events').EventEmitter;
// to only hook emit: hooker.hook(EventEmitter.prototype, 'emit', function () {
hooker.hook(EventEmitter.prototype, function () {
console.log('args', arguments);
});
@thlorenz
thlorenz / aggregating-inside-onouter.js
Last active December 21, 2015 05:09
Sample of inner and outer streams pattern - condensed as much as possible in order to serve as blueprint to generalize and extract module(s).
var from = require('from')
, through = require('through')
;
var outer = from([10, 20, 30, 40]);
var outerStream = through(onouter, onendouter)
, outerPending = 0
, outerEnded;
@thlorenz
thlorenz / dedupe.js
Created August 20, 2013 21:17
ideas to dedupe browserified files before they reach the bundle
// dedupe
var seenSources = {};
var crypto = require('crypto');
var through = require('through');
function getHash(data) {
return crypto
.createHash('md5')
.update(data)
@thlorenz
thlorenz / run-zuul.sh
Last active December 28, 2015 01:18
Run zuul tests locally via mocha-phantomjs
#!/usr/bin/env sh
set -e
function clean {
echo "taking down zuul test server"
kill $!
}
trap clean INT TERM ERR
@thlorenz
thlorenz / log.sh
Created November 14, 2013 22:07
hyperwatch 0.5.1 found, then not
~/dev/cn/template (new-zuul *%)
➝ npm ts
> cnt-feature-template@0.0.0 test /Users/thlorenz/dev/cn/template
> ./test.sh
Running "init:/Users/thlorenz/dev/cn/template" (init) task
This task will create one or more files in the current directory, based on the
environment and the answers to a few questions. Note that answering "?" to any
question will show question-specific help and answering "none" to most questions
@thlorenz
thlorenz / sample.js
Last active February 26, 2019 03:56
Why is fs.createReadStream always emitting buffers? Read the comment and corrected sample to find the answer ;)
var stream = require('stream');
var util = require('util');
var Writable = stream.Writable;
module.exports = CheckEncodingWritable;
util.inherits(CheckEncodingWritable, Writable);
function CheckEncodingWritable (opts) {