Skip to content

Instantly share code, notes, and snippets.

View xdenser's full-sized avatar

Denys Khanzhiyev xdenser

  • Prague, Czech Republic
View GitHub Profile
var
fs = require('fs'),
util = require('util'),
stream = require('stream');
util.inherits(PxyStream,stream.Readable);
function PxyStream(path,readStream,writeStream,start,end){
stream.Readable.call(this);
this.path = path;
this.readStream = readStream;
@xdenser
xdenser / testCatchStream.js
Last active August 29, 2015 13:56
Weird behaviour of CatchStream implementation. It seems made by NodeJS recomendations. Intended to read growing file, but sometimes chunks order is swapped.
var
fs = require('fs'),
path =require('path'),
len = 64*1024,
qlen = (len >> 2),
testFile = path.join(__dirname,'testFile');
/*
Generate test file with growing bytes
*/
var dgram = require('dgram'),
vsocket = dgram.createSocket('udp4'),
dataRcv=0, prevDataRcv=0;
setInterval(function(){
console.log('Rcv rate',dataRcv-prevDataRcv);
prevDataRcv = dataRcv;
},1000)
@xdenser
xdenser / building node-webkit on armv7 hardfp
Last active February 4, 2017 12:16
Building node webkit v0.9.2 on Odroid U3
sudo apt-get install libatk1.0-0 libc6 libasound2 libcairo2 libcups2 libexpat1 libfontconfig1 libfreetype6 libglib2.0-0 libgnome-keyring0 libgtk2.0-0 libpam0g libpango1.0-0 libpci3 libpcre3 libpixman-1-0 libpng12-0 libspeechd2 libstdc++6 libsqlite3-0 libx11-6 libxau6 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxrandr2 libxrender1 libxtst6 zlib1g apache2.2-bin bison curl elfutils fakeroot flex g++ gperf libapache2-mod-php5 libasound2-dev libbz2-dev libcairo2-dev libcups2-dev libcurl4-gnutls-dev libelf-dev libgconf2-dev libgl1-mesa-dev libglib2.0-dev libglu1-mesa-dev libgnome-keyring-dev libgtk2.0-dev libkrb5-dev libnspr4-dev libnss3-dev libpam0g-dev libpci-dev libpulse-dev libsctp-dev libspeechd-dev libsqlite3-dev libssl-dev libudev-dev libwww-perl libxslt1-dev libxss-dev libxt-dev libxtst-dev mesa-common-dev metacity patch perl php5-cgi pkg-config python python-cherrypy3 python-dev python-psutil rpm ruby subversion ttf-dejavu-core ttf-indic-fonts ttf-koc
@xdenser
xdenser / gist:817dc03dd5d36a9004fe
Created July 6, 2014 08:37
Build memcpy for nw-f2cwa-play under OSX
mkdir nw-f2cwa-memcpy
cd nw-f2cwa-memcpy
mkdir osx
git clone https://github.com/xdenser/node-memcpy
cd node-memcpy
npm install
nw-gyp clean
nw-gyp configure --target=0.7.5
nw-gyp build
cp build/Release/memcpy.node ../osx/memcpy.node.0.7.5