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
| <%= CSV.generate do |csv| %> | |
| <% csv << ["All Orders"] %> | |
| <% csv << [] %> | |
| <% total = 0.0 %> | |
| <% orders.each do |order| %> | |
| <% csv << [order.id, order.subtotal, order.tax, order.shipping, order.total] %> | |
| <% total += order.total %> | |
| <% end %> | |
| <% csv << [] %> | |
| <% csv << ["Total", total] %> |
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 method_name | |
| state.thing_that_throws | |
| rescue | |
| state.error | |
| ensure | |
| state.thing | |
| state | |
| 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
| drew:~/projects/prj$ zeus start | |
| Starting Zeus server v0.15.5.rc1 | |
| [ready] [crashed] [running] [connecting] [waiting] | |
| boot | |
| └── default_bundle | |
| ├── development_environment | |
| │ └── prerake | |
| └── test_environment | |
| └── test_helper |
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
| panic: runtime error: invalid memory address or nil pointer dereference | |
| [signal 0xb code=0x1 addr=0x0 pc=0x0] | |
| goroutine 10 [running]: | |
| runtime.gopanic(0x5a7020, 0xc8200101b0) | |
| /usr/local/go/src/runtime/panic.go:461 +0x3e6 | |
| runtime.panicmem() | |
| /usr/local/go/src/runtime/panic.go:42 +0x49 | |
| runtime.sigpanic() | |
| /usr/local/go/src/runtime/sigpanic_unix.go:24 +0x2ba |
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 delete_failed_job_if | |
| redis = Resque.redis | |
| (0...Resque::Failure.count).each do |i| | |
| string = redis.lindex(:failed, i) | |
| break if string.nil? | |
| job = Resque.decode(string) | |
| should_delete_job = yield job | |
| next unless should_delete_job |
OlderNewer