Skip to content

Instantly share code, notes, and snippets.

var fs = require('fs'),
request = require('request');
var download = function(uri, filename, callback){
request.head(uri, function(err, res, body){
console.log('content-type:', res.headers['content-type']);
console.log('content-length:', res.headers['content-length']);
request(uri).pipe(fs.createWriteStream(filename)).on('close', callback);
});
rm -rf ~/.nvm
rm -rf ~/.npm
rm -rf ~/.bower
go to /usr/local/lib and delete any node and node_modules
go to /usr/local/include and delete any node and node_modules directory
if you installed with brew install node, then run brew uninstall node in your terminal
check your Home directory for any "local" or "lib" or "include" folders, and delete any "node" or "node_modules" from there
go to /usr/local/bin and delete any node executable
You may need to do the additional instructions as well:
@pavelbinar
pavelbinar / gist:9506768
Last active August 29, 2015 13:57
clear google chrome dns cache
chrome://net-internals/#dns
sudo killall -HUP mDNSResponder
@pavelbinar
pavelbinar / mDNSResponder.sh
Created March 15, 2014 17:58 — forked from mipmip/gist:1844353
mDNSResponder
# Load up Terminal (Applications > Utilities > Terminal.app) and type the following.
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
# To turn it back on, just do the opposite:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
@pavelbinar
pavelbinar / gist:9944619
Created April 2, 2014 22:33
mac os x host file
sudo subl /private/etc/hosts
#!/bin/bash
ls -1 | while read d
do
test -d "$d" || continue
echo $d
(cd $d ; echo "In ${PWD}")
done
sudo add-apt-repository ppa:webupd8team/unstable && sudo apt-get update
sudo apt-get install mc
@pavelbinar
pavelbinar / Install-rsync.md
Created April 16, 2014 15:31
Install rsync.

Install rsync

Install Homebrew

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Install rsync

brew install https://raw.github.com/Homebrew/homebrew-dupes/master/rsync.rb

Install Node.js with nvm

curl https://raw.githubusercontent.com/creationix/nvm/v0.13.1/install.sh | bash

logout and login

nvm ls-remote