git (private server)
Alternative: github
Cashboard
# Run me with: | |
# | |
# $ watchr plugins.watchr.rb | |
# -------------------------------------------------- | |
# Convenience Methods | |
# -------------------------------------------------- | |
def run(cmd) | |
puts(cmd) | |
system(cmd) |
# See: http://stackoverflow.com/questions/1226302/how-to-monitor-delayedjob-with-monit/1285611 | |
check process delayed_job with pidfile /full/path/to/app/shared/pids/delayed_job.pid | |
start program = "/bin/su - deploy_username -c 'cd /full/path/to/app/current/; RAILS_ENV=production script/delayed_job start'" | |
stop program = "/bin/su - deploy_username -c 'cd /full/path/to/app/current/; RAILS_ENV=production script/delayed_job stop'" |
require 'mysql2' | |
require 'mysql2/em' | |
class MysqlConnectionPool | |
def initialize(conf) | |
@pool_size = conf[:size] || 10 | |
@connections = [] | |
@query_queue = EM::Queue.new | |
start_queue conf |
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) | |
require "rvm/capistrano" | |
# REPLACE this below with your ruby version/gemset version: YOUR_RUBY_VERSION@YOUR_GEM_SET | |
set :rvm_ruby_string, 'ruby-1.9.2-p136@example_gemset' | |
set :use_sudo, false | |
set :stages, %w(production staging) | |
set :default_stage, "staging" | |
require 'capistrano/ext/multistage' |
>> dates | |
=> [#<Date: 2011-07-01 (4911487/2,0,2299161)>, #<Date: 2011-07-20 (4911525/2,0,2299161)>] | |
>> Date.today - dates.map { |d| Date.today - d }.map(&:to_f).inject { |sum, diff| sum + diff } / dates.length | |
=> #<Date: 2011-07-10 (2455753.0,0,2299161)> | |
>> |
#!/usr/bin/ruby | |
require 'stringio' | |
module AB | |
class Response | |
class << self | |
def parse_string(string) | |
new.tap {|res| res.parse_string(string) } | |
end |
# redMine - project management software | |
# Copyright (C) 2008 Jean-Philippe Lang | |
# | |
# This program 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 2 | |
# of the License, or (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |