To uninstall the Heroku Toolbelt on OSX (non-Homebrew) or Standalone Linux install:
rm -rf /usr/local/heroku
rm -rf ~/.heroku
For Homebrew:
To uninstall the Heroku Toolbelt on OSX (non-Homebrew) or Standalone Linux install:
rm -rf /usr/local/heroku
rm -rf ~/.heroku
For Homebrew:
| get '/user/:id' do |user_id| | |
| user = db.find_user(user_id) | |
| return user | |
| end |
| app.get('/user/:id', function (req, res) { | |
| db.get(req.params.userId, function (err, user) { | |
| if (err) throw err; | |
| res.json(user); | |
| }); | |
| }); |
| yum update -y | |
| yum install -y git nodejs npm vim | |
| npm install -g n | |
| n stable | |
| node --version | |
| git --version | |
| vim /etc/yum.repos.d/mongodb.repo | |
| [mongodb] | |
| name=MongoDB Repository |
| yum update -y | |
| yum install -y git nodejs npm vim | |
| npm install -g n | |
| n stable | |
| node --version | |
| git --version | |
| vim /etc/yum.repos.d/mongodb.repo | |
| #[mongodb] | |
| #name=MongoDB Repository |
| yum update -y | |
| yum install -y git nodejs npm vim | |
| npm install -g n | |
| n stable | |
| node --version | |
| git --version | |
| vim /etc/yum.repos.d/mongodb.repo | |
| #[mongodb] | |
| #name=MongoDB Repository |
| #!/usr/bin/env bash | |
| cd ~/src |
Error checking with callbacks:
dbFind('foo', function(err, data) {
if (err) throw err;
dbFind(data.id, function(err, data) {
if (err) throw err;
dbFind(data.id, function(err, data) {
if (err) throw err;
dbFind(data.id, function(err, data) {| 'use strict'; | |
| var numCpus = require('os').cpus().length | |
| var cluster = require('cluster') | |
| cluster.setupMaster({exec: __dirname + '/server.js'}) | |
| // workerIds returns the node cluster index for each worker | |
| function workerIds() { return Object.keys(cluster.workers) } | |
| // Gets the count of active workers |
| var gulp = require('gulp') | |
| var concat = require('gulp-concat') | |
| var sourcemaps = require('gulp-sourcemaps') | |
| var uglify = require('gulp-uglify') | |
| var ngAnnotate = require('gulp-ng-annotate') | |
| gulp.task('js', function () { | |
| gulp.src(['src/**/module.js', 'src/**/*.js']) | |
| .pipe(sourcemaps.init()) | |
| .pipe(concat('app.js')) |