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
| 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
| var Fiber = require('fibers') | |
| var getResp = function (url, callback) { | |
| var fn = Fiber(function () { | |
| var resp = handleRequest(url); | |
| if (resp.statusCode != 200) { | |
| //handle success response | |
| } else { | |
| //handle other responses here | |
| } |
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 http = require('http') | |
| var server = http.createServer(function(req, res) { | |
| res.writeHead(200, {"Content-Type": "text/plain"}); | |
| res.write("hello \n") | |
| setTimeout(function() { | |
| res.end("world \n") | |
| }, 2000); | |
| }); |
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 r_login = require('./login'); | |
| var r_posts = require('./posts'); | |
| var r_errors = require('./errors'); | |
| var expressWinston = require('express-winston'); | |
| var winston = require('winston'); | |
| module.exports = function(app) { | |
| //express-winston logger makes sense BEFORE the router. |
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 }) |
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
| ### /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
| #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
| <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> | |
OlderNewer