Skip to content

Instantly share code, notes, and snippets.

View JbIPS's full-sized avatar

Jean-Baptiste Richardet JbIPS

View GitHub Profile
@JbIPS
JbIPS / install-haxe-osx
Last active December 17, 2015 09:49
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.
#!/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 &&
@JbIPS
JbIPS / switchHaxe.sh
Created May 17, 2013 09:05
This script allows you to easily switch between multiples install of Haxe made by my install script "install-haxe-osx".
#!/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 / stream-concat.js
Created July 21, 2016 09:13
Readable stream which concatenate multiples readable streams in Node.js
var Readable = require('stream').Readable
var util = require('util');
function ConcatStream(){
Readable.call(this);
this.streams = [];
}
util.inherits(ConcatStream, Readable);
@JbIPS
JbIPS / binary_tree.js
Created April 13, 2022 16:12
How much are smaller than I 2
class Node {
constructor(value) {
this.val = value;
this.left = null;
this.right = null;
this.elemCount = 1
this.leftCount = 0
}
}