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 WarnTS | |
| def self.warn_now(msg='') | |
| msg = Time.now.to_s(:db) + msg | |
| warn msg | |
| 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
| # 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 :carefully do | |
| namespace :resque do | |
| task :redis_available do | |
| unless $redis | |
| warn "Redis not available..." | |
| exit(1) |
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
| # A class that swallows any and | |
| # all calls to itself or it's objects. | |
| # | |
| class BlackHole < BasicObject | |
| class << self | |
| def method_missing(*args) | |
| end | |
| end | |
| def method_missing(*args) |
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
| Finished tests in 91.886982s, 33.9221 tests/s, 105.4883 assertions/s. | |
| 1) Failure: | |
| test_should_serialize_binary(NilXmlSerializationTest) [/Volumes/Media/Development/OpenSource/forks/rails/activerecord/test/cases/xml_serialization_test.rb:124]: | |
| Failed assertion, no message given. | |
| 2) Failure: | |
| test_should_serialize_boolean(NilXmlSerializationTest) [/Volumes/Media/Development/OpenSource/forks/rails/activerecord/test/cases/xml_serialization_test.rb:139]: | |
| Failed assertion, no message given. |
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
| tb4-staging1:/data/teambox/current$ make stop | |
| kill -s QUIT `cat tmp/pids/unicorn.pid` | |
| tb4-staging1:/data/teambox/current$ ps aux | grep uni | |
| teambox 619 0.0 0.0 3004 1164 ? Ss Jul04 0:00 su - teambox -c cd /data/teambox-enterprise/current; export PORT=5000; bundle exec unicorn -p $PORT -c /data/teambox-enterprise/shared/config/unicorn.rb >> /var/log/teambox-enterprise/web-1.log 2>&1 | |
| teambox 756 0.0 0.0 4464 704 ? S Jul04 0:00 -su -c cd /data/teambox-enterprise/current; export PORT=5000; bundle exec uncorn -p $PORT -c /data/teambox-enterprise/shared/config/unicorn.rb >> /var/log/teambox-enterprise/web-1.log 2>&1 | |
| teambox 997 0.0 1.0 33844 19648 ? Sl Jul04 0:17 unicorn master -p 5000 -c /data/teambox-enterprise/shared/config/unicorn.rb | |
| teambox 1298 0.0 5.2 147332 95120 ? Sl Jul04 0:24 unicorn worker[0] -p 5000 -c /data/teambox-enterprise/shared/config/unicorn.rb |
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
| irb(main):013:0* class AddStateToIncomingEmails < ActiveRecord::Migration | |
| irb(main):014:1> def up | |
| irb(main):015:2> add_column :incoming_emails, :state, :string | |
| irb(main):016:2> end | |
| irb(main):017:1> | |
| irb(main):018:1* def down | |
| irb(main):019:2> end | |
| irb(main):020:1> end | |
| => nil | |
| irb(main):021:0> AddStateToIncomingEmails.migrate(:up) |
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
| set -g prefix C-x | |
| unbind C-b | |
| bind C-x send-prefix | |
| # set -sg escape-time 1 | |
| # set -g base-index 1 | |
| bind r source-file ~/.tmux.conf; display "Reloaded!" | |
| bind | split-window -h | |
| bind - split-window -v |
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
| sudo grep "openid.sreg.email" /var/log/messages | tr "&" "\n" | grep email= | cut -d= -f2 | |
| #add group duplicates | |
| sudo grep "openid.sreg.email" /var/log/messages | tr "&" "\n" | grep email= | cut -d= -f2 | sort | uniq -c | sort -r |
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 'term/ansicolor' | |
| # yeilds a stacktrace for each SQL query | |
| # put this file in config/initializers | |
| class QueryTrace < ActiveSupport::LogSubscriber | |
| include Term::ANSIColor | |
| attr_accessor :trace_queries | |
| def sql(event) #:nodoc: | |
| return unless QueryTrace.enabled? && logger.debug? && Rails.env.development? |
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
| set nocompatible | |
| filetype off | |
| set rtp+=~/.vim/bundle/vundle/ | |
| call vundle#rc() | |
| " let Vundle manage Vundle | |
| " required! | |
| Bundle 'gmarik/vundle' |