I hereby claim:
- I am denmarkin on github.
- I am denmarkin (https://keybase.io/denmarkin) on keybase.
- I have a public key ASCpGeeJGVUX_VHJR-x-QXpS-IOj0NY-aqqjU8_n0oYkcwo
To claim this, I am signing this object:
sessions: | |
signed_in: 'Signed in successfully.' | |
signed_in_first_time: "MY CUSTOM WELCOME GREETING. DO NOT FORGET TO READ OUR GUIDELINE!" | |
signed_out: 'Signed out successfully.' |
# see http://stackoverflow.com/questions/5880962/how-to-destroy-jobs-enqueued-by-resque-workers - old version | |
# see https://github.com/defunkt/resque/issues/49 | |
# see http://redis.io/commands - new commands | |
namespace :resque do | |
desc "Clear pending tasks" | |
task :clear => :environment do | |
queues = Resque.queues | |
queues.each do |queue_name| | |
puts "Clearing #{queue_name}..." |
Then(/^I should see (.+) table$/) do |table_id, expected_table| | |
html_table = table_at("##{table_id.parameterize.tableize}").to_a | |
html_table.map! { |r| r.map! { |c| c.gsub(/<.+?>/, '').gsub(/[\n\t\r]/, '') } } | |
expected_table.diff!(html_table) | |
end |
# 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'" |
God.watch do |w| | |
w.name = "mysqld" | |
w.interval = 30.seconds # default | |
w.start = "service mysql start" | |
w.stop = "service mysql stop" | |
w.restart = "service mysql restart" | |
w.start_grace = 20.seconds | |
w.restart_grace = 20.seconds | |
w.pid_file = "/var/lib/mysql/hostname.pid" | |
I hereby claim:
To claim this, I am signing this object:
# See http://rubydoc.info/gems/will_paginate/2.3.15/WillPaginate/Collection.create | |
# See https://github.com/mislav/will_paginate/blob/master/lib/will_paginate/array.rb | |
# Do in application_helper.rb or application_controller.rb (or somewhere else application-wide) | |
require 'will_paginate/collection' | |
Array.class_eval do | |
def paginate(options = {}) | |
raise ArgumentError, "parameter hash expected (got #{options.inspect})" unless Hash === options | |
WillPaginate::Collection.create( | |
options[:page] || 1, |
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; |
10/20 13:43:40 MyBookWorld daemon.err afpd[4173]: Can't open volume "/DataVolume/.timemachine" CNID backend "cdb" | |
10/20 13:43:40 MyBookWorld daemon.err afpd[4173]: Cannot open CNID db at [/DataVolume/.timemachine]. | |
10/20 13:43:40 MyBookWorld daemon.err afpd[4173]: cnid_open: dbenv->open of /DataVolume/.timemachine/.AppleDB failed: DB_VERSION_MISMATCH: Database environment version mismatch | |
10/20 13:43:40 MyBookWorld daemon.err afpd[4173]: cnid_open: dbenv->open (rw) of /DataVolume/.timemachine/.AppleDB failed: DB_VERSION_MISMATCH: Database environment version mismatch | |
10/20 13:43:39 MyBookWorld daemon.notice afpd[4173]: AFP3.3 Login by WD_Backup | |
10/20 13:38:24 MyBookWorld daemon.info wixEvent[3626]: Network IP Address - NIC 1 use static IP address 192.168.1.60 | |
10/20 13:38:23 MyBookWorld daemon.warn wixEvent[3626]: Volume Used - Volume 'DataVolume' had reached 80% capacity. | |
10/20 13:38:06 MyBookWorld daemon.info wixEvent[3626]: Network Link - NIC 1 link is up 100 Mbps full duplex. | |
10/20 13:36:2 |
def collect_shared_error_messages(target) | |
targets = [] | |
error_messages = [] | |
if target.kind_of?(Array) | |
target.collect {|t| targets << t} | |
else | |
targets << target | |
end | |
targets.each do |target| | |
target.errors.full_messages.collect {|msg| error_messages << msg} if target.errors.any? |