Skip to content

Instantly share code, notes, and snippets.

View finnp's full-sized avatar
🦆

Finn Pauls finnp

🦆
View GitHub Profile
{"a": 1, "b": 2}
{"a": 2, "b": 3}
{"a": 0, "b": 5}
var encode = require('png-chunk-stream').encode
var decode = require('png-chunk-stream').decode
var fs = require('fs')
// works fine
// fs.createReadStream('test.png')
// .pipe(decode())
// .pipe(encode())
// .pipe(fs.createWriteStream('out2.png'))
var streampng = require('streampng')
var concat = require('concat-stream')
var imagebase64 = 'iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAARj0lEQVR4nO3df+xddX3H8ef5rmmapmPYIAHXNUuFjnVTdHZ1AxWKDSVEfmyw6XKWOd2cOLMsC8lwadA/DJKYIW7OAFti1OxEGQijLGBJsdWZStApQ1IJdE3HSNcx1jSkaUjT9OyPc+7X+/1+z733nHPPOe/Pj9cjMcF+7/f7fUf7evG5557z+YCI4/KMNXnGaus5QpRYDyCyXJ6xDvgwcAOwFTin/NKrwAHgUeCrScppmwnDoQIQp+QZfwzcAZw/46UvAX+RpDzU/1ThUgGIE8ol/n3AHzb81s8Au5K085GioAIQc2X4HwCub/kj7gU+phJoTgUgpjoI/4hKoAUVgJjpMPwjKoGGVABioofwj6gEGlAByOB6DP+ISqAmFYAMaoDwj6gEalAByGAGDP+ISmAGFYAMwiD8IyqBKVQA0jvD8I+oBCZYsB5AwlaG/37swg9wC3BPnhlO4CitAKQ3Y+G/0XqWklYCy6gApBcOhn9EJTBGBSCdczj8IyqBkgpAOuVB+EdUAqgApEMehX8k+hJQAUgnPAz/SNQloI8BZW4ehx+Kmc+1HsKKCkDm4nn4Af4oSTlhPYQVFYC0FkD4701SHrMewpIKQFrJM1bhd/gPAbdaD2FNBSCNleF/AH/DD/CRJOWU9RDW9CmANBJI+L+TpFxhPYQLtAKQ2gIJP8Cd1gO4QisAqSWg8P8wSXmH9RCu0ApAZgoo/FCcOiQlFYBMFVj4TwC7rYdwiQpAJgos/AB7k5Qz1kO4RAUg06wBvg28Zj1IR/ZYD+AaXQSUmfKMi4AngY3Ws8zpF5KUl62HcIlWADJTknII2E5xJLevDir8K6kApJYk5TB+l8DT1gO4SAUgtY2VwDHrWVr4D+sBXKQCk
var png = require('streampng')()
var http = require('http')
http.request('http://nodejs.org/images/logo.png', function(res) {
res.pipe(png)
}).end();
png.on('chunk', function(chunk) {
console.dir(chunk);
});
var http = require('http')
http.createServer(function (req, res) {
res.end('hello what if this happens to be a HEAD?')
}).listen(8000)
@finnp
finnp / shell
Created September 9, 2014 20:48
finn_air:ckanDOWN$ npm install abstract-leveldown
[email protected] node_modules/abstract-leveldown
└── [email protected]
@finnp
finnp / test.csv
Last active August 29, 2015 14:06
key value
key value
finn_air:dat-berlin-badegewaesser$ echo '{"key": 1, "value1": 1}' | dat import --json [master]
No import file specified, using STDIN as input
Elapsed : 0 s
Parsed : 3 B (3 B/s)
- changes : 1
Done
finn_air:dat-berlin-badegewaesser$ echo '{"key": 1, "value2": 1}' | dat import --json [master]
No import file specified, using STDIN as input
Elapsed : 0 s
@finnp
finnp / test.js
Last active August 29, 2015 14:05
var createReadStream = function () {
// is there a cooler way to do this?
var stream = new Transform
stream._transform = function (a, enc, cb) { this.push(a); cb() }
functionWithcallback(function(readStream) {
readStream.pipe(stream)
}
return stream
}