This article is now published on my website: Prefer Subshells for Context.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
VERSION=0.8.6 | |
PLATFORM=darwin | |
ARCH=x64 | |
PREFIX="$HOME/node-v$VERSION-$PLATFORM-$ARCH" | |
mkdir -p "$PREFIX" && \ | |
curl http://nodejs.org/dist/v$VERSION/node-v$VERSION-$PLATFORM-$ARCH.tar.gz \ | |
| tar xzvf - --strip-components=1 -C "$PREFIX" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ echo 0 | ruby -ne 'puts (n=($_.to_f*8).ceil)==0?" ":[[8,[0,n].max].min+0x2580].pack("U*")' | |
$ echo .25 | ruby -ne 'puts (n=($_.to_f*8).ceil)==0?" ":[[8,[0,n].max].min+0x2580].pack("U*")' | |
▂ | |
$ echo .3 | ruby -ne 'puts (n=($_.to_f*8).ceil)==0?" ":[[8,[0,n].max].min+0x2580].pack("U*")' | |
▃ | |
$ echo .4 | ruby -ne 'puts (n=($_.to_f*8).ceil)==0?" ":[[8,[0,n].max].min+0x2580].pack("U*")' |