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
| Muddling with Modules | |
| Goals: | |
| How do most of us use modules? | |
| How do we change the way we use modules? | |
| Topics: | |
| Including/Extending | |
| Namespacing | |
| Mixing In |
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 SheetWorker | |
| include Sidekiq::Worker | |
| sidekiq_options queue: :critical, :retry => 3 | |
| def perform(id) | |
| sheet = Sheet.find(id) | |
| if sheet.failed? | |
| sheet.resend_failed_sheet | |
| end | |
| begin |
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
| HTMLHelper | |
| <repl type="ruby"> | |
| <code file="timer" operation="append/create"> | |
| require 'lib/clock.rb' | |
| class Timer | |
| def tick | |
| Clock.new.rewind | |
| end | |
| end | |
| </code> |
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 Board | |
| #properties | |
| attr_accessor :location | |
| attr_accessor :width | |
| attr_accessor :height | |
| attr_accessor :name | |
| #relationships | |
| attr_accessor :image | |
| attr_accessor :contract |
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
| results1@surehire.mailgun.org, | |
| results2@surehire.mailgun.org, | |
| results3@surehire.mailgun.org, | |
| results4@surehire.mailgun.org, | |
| results5@surehire.mailgun.org, | |
| results6@surehire.mailgun.org, | |
| results7@surehire.mailgun.org, | |
| results8@surehire.mailgun.org, | |
| results9@surehire.mailgun.org, | |
| results10@surehire.mailgun.org, |
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
| package recfun | |
| import common._ | |
| object Main { | |
| def main(args: Array[String]) { | |
| println("Pascal's Triangle") | |
| for (row <- 0 to 10) { | |
| for (col <- 0 to row) | |
| print(pascal(col, row) + " ") | |
| println() |
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
| Phase I | |
| First PDF is uploaded and it is sent to Sidekiq. | |
| If Sidekiq dies and it remains in the Q Backlog infinitely, what do we do? | |
| App precodes: rotates, crops, creates decodings | |
| Failures here are retried thrice, if no success, send email to us and SureWire | |
| Do this yourself / App Error has occurred | |
| Tests are scanned for integrity | |
| Emails are sent for no tests, incomplete test set, unidentified pages and processable pages |
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
| def call(worker, msg, queue) | |
| begin | |
| if msg['retry_count'] && msg['retry_count'] >= @max_retries | |
| ..... | |
| ..... | |
| else | |
| yield | |
| end | |
| rescue => e | |
| raise |
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
| 2012-08-28T19:13:01Z 25218 TID-117y84 SecondaryTestProcessor MSG-zeneo INFO: start | |
| 2012-08-28T19:13:11Z 25218 TID-117y84 WARN: {"retry"=>true, "queue"=>"critical", "backtrace"=>40, "class"=>"SecondaryTestProcessor", "args"=>["503d1443da756c61fa000125"], "jid"=>"2eak6j7a1Kp/C4N47hEZBg=="} | |
| 2012-08-28T19:13:11Z 25218 TID-117y84 WARN: No transition found for event sent_for_work | |
| 2012-08-28T19:13:11Z 25218 TID-117y84 WARN: /usr/local/rvm/gems/ruby-1.9.3-p194/bundler/gems/stateflow-1e526266a2b1/lib/stateflow/event.rb:15:in `fire' | |
| /usr/local/rvm/gems/ruby-1.9.3-p194/bundler/gems/stateflow-1e526266a2b1/lib/stateflow.rb:73:in `fire_event' | |
| /usr/local/rvm/gems/ruby-1.9.3-p194/bundler/gems/stateflow-1e526266a2b1/lib/stateflow.rb:43:in `block (2 levels) in stateflow' | |
| /home/deploy/application/releases/20120828110620/app/models/document.rb:295:in `send_secondary_pages' | |
| /home/deploy/application/releases/20120828110620/app/workers/secondary_test_processor.rb:13:in `block in perform' | |
| /usr/local/rvm/gems/ruby-1.9.3-p194/bundler/ |
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 EventHandler | |
| def initialize | |
| @callbacks = Hash.new { |h,k| h[k] = [] } | |
| end | |
| def on(event, callback) | |
| @callbacks[event] << callback | |
| end | |
| def trigger(event, *args) |