Skip to content

Instantly share code, notes, and snippets.

Jean-Baptiste Richardet JbIPS

View GitHub Profile
@JbIPS
JbIPS / stream-concat.js
Created Jul 21, 2016
Readable stream which concatenate multiples readable streams in Node.js
View stream-concat.js
var Readable = require('stream').Readable
var util = require('util');
function ConcatStream(){
Readable.call(this);
this.streams = [];
}
util.inherits(ConcatStream, Readable);
@JbIPS
JbIPS / switchHaxe.sh
Created May 17, 2013
This script allows you to easily switch between multiples install of Haxe made by my install script "install-haxe-osx".
View switchHaxe.sh
#!/bin/bash
i=0
while read line; do
targets[i]=$line
v=$($line"/haxe" 2>&1 | head -1)
[[ $v =~ [0-9]+\.[0-9]+(\.[0-9]+)? ]] && versions[i]=$BASH_REMATCH
i=$((i+1))
done < <(find /usr/lib -name haxe\* -depth 1 -type d)
echo 'Which installed version of Haxe you want to set ?'
@JbIPS
JbIPS / install-haxe-osx
Last active Dec 17, 2015
Script to install Haxe 3.0.0-RC2 along with another Haxe version. Create a symbolic link in /usr/lib/haxe which will target haxe3, but you can easily change it to target your older version (renamed /usr/lib/haxe2). Must be executed as root.
View install-haxe-osx
#!/bin/bash
if [[ -z $1]]; then
v=3.0.0
else
v=$1
fi
echo "Downloading and installing Haxe3"
curl http://haxe.org/file/haxe-$v-osx.tar.gz -o haxe-$v-osx.tar.gz &&
tar -xzf haxe-$v-osx.tar.gz &&
You can’t perform that action at this time.