This file contains hidden or 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
| module.exports = tree | |
| tree.sync = treeSync | |
| var fs = require("fs") | |
| , path = require("path") | |
| function tree (root, cb) { | |
| fs.lstat(root, function (er, s) { | |
| if (er) return cb(er) | |
| s.name = root |
This file contains hidden or 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 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
This file contains hidden or 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/bash | |
| SERVER=https://api.no.de | |
| SCRIPT="$0" | |
| if [ ${SCRIPT:0:1} == "/" ]; then | |
| SCRIPT="$(basename -- "$SCRIPT")" | |
| fi | |
| main () { | |
| cmd=${1-help} |
This file contains hidden or 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
| var http = require("http") | |
| , util = require("sys") // 0.3.x: require("util") | |
| , fs = require("fs") | |
| , client = http.createClient(80, "example.com") | |
| , request = client.request("POST", "/", {"host":"example.com"}) | |
| // send body chunks | |
| request.write("hello, world") | |
| // pump a file through |
This file contains hidden or 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
| #!/usr/bin/env node | |
| var args = process.argv.slice(2) | |
| , arg | |
| , requestedUid = 0 | |
| , cmd = [] | |
| , cmdArgs | |
| , tty = process.binding("stdio") | |
| , path = require("path") | |
| , usage = path.basename(__filename) |
This file contains hidden or 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
| var fs = require("fs") | |
| , http = require("http") | |
| , util = require("sys") // 0.3.x: require("util") | |
| , fileToUpload = "/tmp/request" | |
| , fileToDownload = "/tmp/response" | |
| , server = "example.com" | |
| , port = 80 | |
| , path = "/upload/target" | |
| , method = "PUT" | |
| , headers = { "content-type":"text/plain", "accept":"text/html" } |
This file contains hidden or 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
| exports.isReadable = isReadable | |
| exports.isReadableSync = isReadableSync | |
| exports.isWritable = isWritable | |
| exports.isWritableSync = isWritableSync | |
| exports.isExecutable = isExecutable | |
| exports.isExecutableSync = isExecutableSync | |
| function isReadable (path, cb) { | |
| fs.stat(path, function (er, s) { | |
| if (er) return cb(er) |
This file contains hidden or 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
| for i in $HOME/local/*; do | |
| [ -d $i/bin ] && PATH="${i}/bin:${PATH}" | |
| [ -d $i/sbin ] && PATH="${i}/sbin:${PATH}" | |
| [ -d $i/include ] && CPATH="${i}/include:${CPATH}" | |
| [ -d $i/lib ] && LD_LIBRARY_PATH="${i}/lib:${LD_LIBRARY_PATH}" | |
| [ -d $i/lib ] && LD_RUN_PATH="${i}/lib:${LD_RUN_PATH}" | |
| # uncomment the following if you use macintosh | |
| # [ -d $i/lib ] && DYLD_LIBRARY_PATH="${i}/lib:${DYLD_LIBRARY_PATH}" | |
| [ -d $i/lib/pkgconfig ] && PKG_CONFIG_PATH="${i}/lib/pkgconfig:${PKG_CONFIG_PATH}" | |
| [ -d $i/share/man ] && MANPATH="${i}/share/man:${MANPATH}" |
OlderNewer