start new:
tmux
start new with session name:
tmux new -s myname
| // node: v0.10.21 | |
| // request: 2.27.0 | |
| var request = require('request'); | |
| var fs = require('fs'); | |
| var r = request.post("http://server.com:3000/"); | |
| // See http://nodejs.org/api/stream.html#stream_new_stream_readable_options | |
| // for more information about the highWaterMark | |
| // Basically, this will make the stream emit smaller chunks of data (ie. more precise upload state) | |
| var upload = fs.createReadStream('f.jpg', { highWaterMark: 500 }); |
| #!/bin/bash | |
| # This script zeroes out any space not needed for packaging a new Ubuntu Vagrant base box. | |
| # Run the following command in a root shell: | |
| # | |
| # bash <(curl -s https://gist.github.com/justindowning/5670884/raw/vagrant-clean.sh) | |
| function print_green { | |
| echo -e "\e[32m${1}\e[0m" | |
| } |
| /** | |
| * Converts an RGB color value to HSL. Conversion formula | |
| * adapted from http://en.wikipedia.org/wiki/HSL_color_space. | |
| * Assumes r, g, and b are contained in the set [0, 255] and | |
| * returns h, s, and l in the set [0, 1]. | |
| * | |
| * @param Number r The red color value | |
| * @param Number g The green color value | |
| * @param Number b The blue color value | |
| * @return Array The HSL representation |
| --[[ deepcopy.lua | |
| Deep-copy function for Lua - v0.2 | |
| ============================== | |
| - Does not overflow the stack. | |
| - Maintains cyclic-references | |
| - Copies metatables | |
| - Maintains common upvalues between copied functions (for Lua 5.2 only) | |
| TODO |
| function clone (t) -- deep-copy a table | |
| if type(t) ~= "table" then return t end | |
| local meta = getmetatable(t) | |
| local target = {} | |
| for k, v in pairs(t) do | |
| if type(v) == "table" then | |
| target[k] = clone(v) | |
| else | |
| target[k] = v | |
| end |
| ### Check me into the root of the repo | |
| ### as .gitattributes | |
| *.doc diff=astextplain | |
| *.DOC diff=astextplain | |
| *.docx diff=astextplain | |
| *.DOCX diff=astextplain | |
| *.dot diff=astextplain | |
| *.DOT diff=astextplain |
To run this, you can try:
curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream