This file contains 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
Resque::Failure.all(Resque::Failure.count-5,5).each { |job| puts "#{job["exception"]} #{job["backtrace"]}" } | |
fail_counts = {} | |
Resque::Failure.all(0,Resque::Failure.count).each do |job| | |
if fail_counts[job['queue']] | |
fail_counts[job['queue']] += 1 | |
else | |
fail_counts[job['queue']] = 1 | |
end | |
end |
This file contains 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
# https://sebastianvoss.com/docker-mongodb-sharded-cluster.html | |
# rs1_srv1 172.17.0.20:49170 | |
# rs1_srv2 172.17.0.21:49171 | |
# rs1_srv3 172.17.0.22:49172 | |
# rs2_srv1 172.17.0.23:49173 | |
# rs2_srv2 172.17.0.24:49174 | |
# rs2_srv3 172.17.0.25:49175 | |
# cfg1 172.17.0.26:49176 | |
# mongos1 172.17.0.27:49177 |
This file contains 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
task :do_a_thing => :environment do | |
zh_cn = " 联想" | |
zh_tw = " 聯想" | |
%w( zh-cn zh-tw ).each do |chinese| | |
lang = Language.find_by_language_code(chinese) | |
LocalizedString.all(:conditions => ["language_id = ? and string_value like '%FindMe%'", lang.id]).each do |loc| | |
loc.string_value.gsub!('FindMe', send(chinese.underscore)) | |
loc.save_without_validation |
This file contains 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
task :do_a_thing => :environment do | |
def zh_cn; " 联想"; end | |
def zh_tw; " 聯想"; end | |
%w( zh-cn zh-tw ).each do |chinese| | |
lang = Language.find_by_language_code(chinese) | |
LocalizedString.all(:conditions => ["language_id = ? and string_value like '%FindMe%'", lang.id]).each do |loc| | |
loc.string_value.gsub!('FindMe', send(chinese.underscore)) | |
loc.save_without_validation |
This file contains 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
andy@hst-26-147->rvm --trace list | |
+ [[ -z '' ]] | |
+ export 'PS4=+ ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > ' | |
+ PS4='+ ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > ' | |
+ /scripts/cli : __rvm_parse_args() 693 > [[ -z '' ]] | |
+ /scripts/cli : __rvm_parse_args() 693 > [[ -n '' ]] | |
+ /scripts/cli : __rvm_parse_args() 695 > [[ 0 -eq 1 ]] | |
+ /scripts/cli : __rvm_parse_args() 695 > [[ -n '' ]] | |
+ /scripts/cli : __rvm_parse_args() 14 > [[ -n list ]] | |
+ /scripts/cli : __rvm_parse_args() 16 > rvm_token=list |
This file contains 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
PGError: server closed the connection unexpectedly | |
This probably means the server terminated abnormally | |
before or while processing the request. | |
: BEGIN (ActiveRecord::StatementInvalid) | |
/Users/andy/.rvm/gems/kiji-head/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log' | |
/Users/andy/.rvm/gems/kiji-head/gems/activerecord-2.3.11/lib/active_record/connection_adapters/postgresql_adapter.rb:520:in `execute' | |
/Users/andy/.rvm/gems/kiji-head/gems/activerecord-2.3.11/lib/active_record/connection_adapters/postgresql_adapter.rb:536:in `begin_db_transaction' | |
/Users/andy/.rvm/gems/kiji-head/gems/activerecord-2.3.11/lib/active_record/fixtures.rb:934:in `setup_fixtures' | |
/Users/andy/.rvm/gems/kiji-head/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:178:in `send' | |
/Users/andy/.rvm/gems/kiji-head/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:178:in `evaluate_method' |
This file contains 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
And each english_string is referenced by a string_group_def # features/step_definitions/more_web_steps.rb:1 | |
/Users/andy/.rvm/rubies/kiji-head/lib/ruby/1.8/uri/generic.rb:732:in `merge': stack level too deep (SystemStackError) | |
from /Users/andy/.rvm/gems/kiji-head/gems/selenium-webdriver-0.2.0/lib/selenium/webdriver/remote/http/common.rb:24:in `call' | |
from /Users/andy/.rvm/gems/kiji-head/gems/selenium-webdriver-0.2.0/lib/selenium/webdriver/remote/bridge.rb:476:in `raw_execute' | |
from /Users/andy/.rvm/gems/kiji-head/gems/selenium-webdriver-0.2.0/lib/selenium/webdriver/remote/bridge.rb:454:in `execute' | |
from /Users/andy/.rvm/gems/kiji-head/gems/selenium-webdriver-0.2.0/lib/selenium/webdriver/remote/bridge.rb:177:in `quit' | |
from /Users/andy/.rvm/gems/kiji-head/gems/selenium-webdriver-0.2.0/lib/selenium/webdriver/firefox/bridge.rb:40:in `quit' | |
from /Users/andy/.rvm/gems/kiji-head/gems/selenium-webd |
This file contains 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
/Users/andy/.rvm/rubies/kiji-head/lib/ruby/1.8/uri/generic.rb:732:in `merge': stack level too deep (SystemStackError) | |
from /Users/andy/.rvm/gems/kiji-head/gems/selenium-webdriver-0.2.0/lib/selenium/webdriver/remote/http/common.rb:24:in `call' | |
from /Users/andy/.rvm/gems/kiji-head/gems/selenium-webdriver-0.2.0/lib/selenium/webdriver/remote/bridge.rb:476:in `raw_execute' | |
from /Users/andy/.rvm/gems/kiji-head/gems/selenium-webdriver-0.2.0/lib/selenium/webdriver/remote/bridge.rb:454:in `execute' | |
from /Users/andy/.rvm/gems/kiji-head/gems/selenium-webdriver-0.2.0/lib/selenium/webdriver/remote/bridge.rb:177:in `quit' | |
from /Users/andy/.rvm/gems/kiji-head/gems/selenium-webdriver-0.2.0/lib/selenium/webdriver/firefox/bridge.rb:40:in `quit' | |
from /Users/andy/.rvm/gems/kiji-head/gems/selenium-webdriver-0.2.0/lib/selenium/webdriver/common/driver.rb:156:in `quit' | |
from /Users/andy/.rvm/gems/kiji-head/gems/capybara-0.4.1.2/lib/capybara/driver/selenium_driver.rb:96:in `brows |
This file contains 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>>> | |
725 # p uri.merge("/main.rbx?page=1") | |
726 # # => #<URI::HTTP:0x2021f3b0 URL:http://my.example.com/main.rbx?page=1> | |
727 # | |
728 def merge(oth) | |
729 puts "oth: #{oth}" | |
730 begin | |
731 base, rel = merge0(oth) | |
732 rescue | |
733 raise $!.class, $!.message |
This file contains 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
def drop_database(config) | |
case config['adapter'] | |
when /mysql/ | |
ActiveRecord::Base.establish_connection(config) | |
ActiveRecord::Base.connection.drop_database config['database'] | |
when /^sqlite/ | |
require 'pathname' | |
path = Pathname.new(config['database']) | |
file = path.absolute? ? path.to_s : File.join(Rails.root, path) |
OlderNewer