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
| Resque.after_fork do |job| | |
| $rabbitmq_connection = Bunny.new(AMQP_URL) | |
| $rabbitmq_connection.start | |
| $rabbitmq_channel = $rabbitmq_connection.create_channel | |
| $rabbitmq_exchange = $rabbitmq_channel.topic('stream', durable: true) | |
| 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
| irb(main):083:0> order.save.explain | |
| (0.4ms) BEGIN | |
| SQL (15.1ms) INSERT INTO "orders" ("address_id", "created_at", "customer_id", "order_request_id", "price_cents", "shipping_price_cents", "source", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["address_id", 291085], ["created_at", Wed, 10 Sep 2014 19:07:34 UTC +00:00], ["customer_id", 63601], ["order_request_id", "2687c3b4-c0b3-44a1-887d-04073ae62d1b"], ["price_cents", 8900], ["shipping_price_cents", 1200], ["source", "web-cart"], ["updated_at", Wed, 10 Sep 2014 19:07:34 UTC +00:00]] | |
| SQL (4.1ms) UPDATE "customers" SET "orders_count" = COALESCE("orders_count", 0) + 1 WHERE "customers"."id" = 63601 | |
| SQL (7.9ms) INSERT INTO "order_items" ("created_at", "order_id", "photo_count", "printer", "product", "source", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 10 Sep 2014 19:07:34 UTC +00:00], ["order_id", 80566], ["photo_count", 3], ["printer", 1], ["product", "calendardateless"], ["so |
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
| ; Find Nth algorithm | |
| ; | |
| ; This algorithm finds the nth largest element in a list. First, it sorts | |
| ; the list in descending order and then places the value at index n in | |
| ; location 127. | |
| ; | |
| ; Dynamic Instruction Count for 19.b. at location 30 | |
| ; 18,240 instructions | |
| ; 30th largest element in given array is 32 | |
| ; |
NewerOlder