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 'octokit' | |
client = Octokit::Client.new(access_token: ENV['ACCESS_TOKEN']) | |
client.login | |
client.add_deploy_key(ENV['REPO'], 'shipment@github', File.read('/root/.ssh/id_rsa.pub')) |
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 'mina/bundler' | |
require 'mina/rails' | |
require 'mina/git' | |
set :domain, "ip_address" | |
set :deploy_to, "/path/to/app" | |
set :app_path, "#{deploy_to}/#{current_path}" | |
set :repository, "ssh_clone_url" | |
set :branch, "branch" | |
set :user, "username" |
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
class FileFinder | |
def self.location_to_dir(dir_name) | |
new.location_to_dir(dir_name) | |
end | |
def location_to_dir(dir_name) | |
File.join(File.dirname(File.expand_path(__FILE__)), "#{dir_name}") | |
end | |
def self.location_to_file(file_name) |
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
function gho () { | |
if [ -n "$3" ]; then | |
private=$("false") | |
else | |
private=$("true") | |
fi | |
curl -s -u 'username:apikey' https://api.github.com/orgs/"$2"/repos -d "{\"name\":\"$1\",\"private\":\"$private\"}" | |
} |
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
after "deploy:symlink", "deploy:restart_workers" | |
## | |
# Rake helper task. | |
# http://pastie.org/255489 | |
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
def run_remote_rake(rake_cmd) | |
rake_args = ENV['RAKE_ARGS'].to_s.split(',') | |
cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}" |
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
# lib/tasks/deploy.rake | |
namespace :deploy do | |
desc 'Deploy to staging environment' | |
task :staging do | |
exec 'mina deploy -f config/deploy/staging.rb' | |
end | |
end |
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
/*global PushStream WebSocketWrapper EventSourceWrapper EventSource*/ | |
/*jshint evil: true, plusplus: false, regexp: false */ | |
/** | |
* Copyright (C) 2010-2013 Wandenberg Peixoto <[email protected]>, Rogério Carvalho Schneider <[email protected]> | |
* | |
* This file is part of Nginx Push Stream Module. | |
* | |
* Nginx Push Stream Module is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or |
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
FROM ubuntu | |
MAINTAINER Eric Mill "[email protected]" | |
# turn on universe packages | |
RUN echo "deb http://archive.ubuntu.com/ubuntu raring main universe" > /etc/apt/sources.list | |
RUN apt-get update | |
# basics | |
RUN apt-get install -y nginx openssh-server git-core openssh-client curl | |
RUN apt-get install -y nano |
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
$(function(){ | |
function initialize() { | |
var source = new EventSource('/stream?name=Logan'); | |
source.addEventListener('message', function(e){ | |
console.log("Received "+e.data); | |
updateMessagesList(e.data); | |
}, false); | |
source.addEventListener('open', function(e){ | |
console.log('Connection was opened.'); |
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
class Object | |
def lm | |
(self.methods - Object.methods).sort | |
end | |
def lim | |
(self.instance_methods - Object.instance_methods).sort | |
end |