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
require 'awesome_print' | |
read_pipes = Array.new | |
3.times do |index| | |
parent_read, child_write = IO.pipe | |
read_pipes << parent_read | |
fork do | |
begin |
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 new | |
returned_data = Report.get_report | |
respond_to do |format| | |
format.csv{ | |
filename = "#{Report.get_name[params[:id]]}_#{Time.now.strftime("%Y_%m_%d_%H_%M")}_#{branch]}.csv" | |
temp = Tempfile.new(filename) | |
temp << FasterCSV.generate(:force_quotes => true){ |csv| csv << returned_data[:headers]; returned_data[:data].map { |x| csv << x }; } | |
temp.close | |
`pigz #{temp.path}` |
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
Net::SSH.start('<server>','<user_name>',:password => '<secret>') do |ssh| | |
ssh.exec!(". $HOME/.rvm/scripts/rvm; ruby -v") | |
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
/my_gems/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:65:in `protected_instance_variables': undefined method `protected_instance_variables' for #<Hash:0x00000102286768> (NoMethodError) | |
from /my_gems/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:134:in `view_assigns' | |
from /my_gems/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:87:in `view_context' | |
from /my_gems/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:120:in `_render_template' | |
from /my_gems/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:114:in `render_to_body' | |
from /my_gems/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:99:in `render' | |
from /my_gems/gems/actionmailer-3.1.3/lib/action_mailer/base.rb:718:in `block in collect_responses_and_parts_order' | |
from /my_gems/gems/actionmailer-3.1.3/lib/action_mailer/base.rb:729:in `each' | |
from /my_gems/gems/actionmailer-3.1.3/lib/action_mailer/base.rb:729:in `each_template' | |
from /my_gems/gems/actionmailer-3.1.3/lib/action_mailer/base.r |
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
module ActsAsCatchall | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
class << self; attr_accessor :catchall end | |
def acts_as_catchall(options = {}) | |
# db_field, klass, use_method_missing = false |
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
module B | |
def self.included(base) | |
class << base | |
attr_accessor :catch | |
def acts_as_catchall(hsh) | |
self.catch = hsh | |
end | |
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
module B | |
def self.included(base) | |
class << base | |
attr_accessor :catch | |
def acts_as_catchall(hsh) | |
@catch = hsh | |
end | |
def inherited(subclass) | |
subclass.catch = subclass.superclass.catch |
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
[vagrant@localhost ~]$ yum list freetds | |
Loaded plugins: fastestmirror, security | |
Determining fastest mirrors | |
* base: mirrors.seas.harvard.edu | |
* epel: linux.mirrors.es.net | |
* extras: centos.mirror.netriplex.com | |
* updates: mirror.pac-12.org | |
Installed Packages | |
freetds.x86_64 0.91-2.el6 @epel | |
Available Packages |
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
module Devise | |
module Strategies | |
class MyAuthenticatable < Authenticatable | |
def authenticate! | |
begin | |
if resp = authenticate_local | |
else | |
fail!('Invalid username or password') |
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 |