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 db = mongoose.connect('mongodb://localhost:27017/DB'); | |
// In middleware | |
app.use(function (req, res, next) { | |
// action after response | |
var afterResponse = function() { | |
logger.info({req: req}, "End request"); | |
// any other clean ups |
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 autonomy = require('ardrone-autonomy'); | |
var mission = autonomy.createMission(); | |
mission.takeoff() | |
.zero() // current position/orientation as the base state of the kalman filter | |
.hover(1000) | |
.go({x:0, y:0, z:1.5}) | |
.hover(1000) | |
.land(); |
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
require 'json' | |
require 'pp' | |
require 'base64' | |
require 'octokit' | |
require_relative "./GitHubClient" | |
env = ENV['BACKUP_ENV'] || 'dev' | |
config_file = "../config/#{env}.backup.json" | |
config = JSON.parse(IO.read(config_file))['github']; |
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
<form method="post" action="/posts"> | |
<input type="hidden" name="_method" value="put"> | |
<input type="text" name="title"> | |
<textarea name="content"></textarea> | |
<input type="submit" value="Save"> | |
</form> | |
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
#created by @nthgergo | |
set :application, "APPLICATION_NAME" | |
set :scm, :git | |
set :repository, "GIT_URL" | |
set :user, "ec2-user" | |
set :ssh_options, { :forward_agent => true } | |
default_run_options[:pty] = true | |
set :use_sudo, false | |
set :branch, "master" |
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
### host file under sites-available ### | |
# The upstream module is the link between Node.js and Nginx. | |
# Upstream is used for proxying requests to other servers. | |
# All requests for / get distributed between any of the servers listed. | |
upstream app_nodeapp1 { | |
# Set up multiple Node.js webservers for Load balancing. | |
# max_fails refers to number of failed attempts |
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
### /etc/hosts #### | |
# Add to hosts. 192.168.0.13 is your server ip (ifconfig) | |
192.168.0.13 www.site2.com site2.com | |
192.168.0.13 www.site3.com site3.com |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "centos_6.4" | |
config.vm.box_url = "http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130731.box" |
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 bunyan = require('bunyan'); | |
var config = require('./config'); | |
var logSettings = config.logSettings; | |
var log = bunyan.createLogger({ | |
name: config.app_name, | |
src: true, | |
streams : [ | |
{ | |
stream : process.stdout, |
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 winston = require('winston'); | |
var logger = new (winston.Logger)({ | |
transports: [ | |
new (winston.transports.Console)({ json: false, timestamp: true }), | |
new winston.transports.File({ filename: __dirname + '/debug.log', json: false }) | |
], | |
exceptionHandlers: [ | |
new (winston.transports.Console)({ json: false, timestamp: true }), | |
new winston.transports.File({ filename: __dirname + '/uncaught_exceptions.log', json: false }) |