cp /etc/vim/vimrc ~/.vimrc
function getOrdinal(n) {
var s=["th","st","nd","rd"],
v=n%100;
return n+(s[(v-20)%10]||s[v]||s[0]);
}
function empty(data) | |
{ | |
if(typeof(data) == 'number' || typeof(data) == 'boolean') | |
{ | |
return false; | |
} | |
if(typeof(data) == 'undefined' || data === null) | |
{ | |
return true; | |
} |
If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together.
I assume you have Homebrew. If not, go get it. It’s awesome for OSX. You can install tons of great stuff quickly and efficiently with it. Instructions are at the link or for your convenience, run this:
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Custom recipe to get OS X 10.11 El Capitan running from scratch with useful applications and Node.js Developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after fresh install.
Below are summary of getting started from several famous web/mobile framework
$ npm install -g cordova ionic
$ ionic start myApp tabs
Creating initial vagrant file
$ vagrant init
Running precise32
$ vagrant init hashicorp/precise32
db.users.insert({name: 'paulo'})
db.users.insert({name: 'patric'})
db.users.insert({name: 'pedro'})
db.users.find({name: /a/}) //like '%a%'
out: paulo, patric
// Setup express
var app = express();
var server = require('http').createServer(app);
// CORS acceptance
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");