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 Hero | |
| attr_reader :hp | |
| def initialize | |
| @hp = 100 | |
| end | |
| def hit!(force) | |
| @hp -= force | |
| 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
| require "rubygems" | |
| require "sequel" | |
| DB = Sequel.connect("sqlite://urls.db") | |
| class Url < Sequel::Model | |
| plugin :schema | |
| set_schema do | |
| primary_key(:id) |
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 Base62 | |
| @@ranges = [ | |
| ('0'..'9'), | |
| ('a'..'z'), | |
| ('A'..'Z') | |
| ] | |
| @@base = nil | |
| @@offsets = nil | |
| def self.to_s(number) |
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
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
| <script> | |
| $(document).ready(function() { | |
| $.ajax({ | |
| type: "HEAD", | |
| async: true, | |
| url: "http://bashme.org/phd_18yo_apriloneil2_trailer.mov", | |
| success: function(message, text, response) { |
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
| rake qu:work QUEUES=urgent,default |
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
| 3.times do |n| | |
| worker = Delayed::Worker.new | |
| worker.name = 'worker-' + n.to_s | |
| worker.start | |
| 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
| rake jobs:work |
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
| QUEUE=* rake resque:work | |
| QUEUE=notifications rake resque:work | |
| COUNT=5 QUEUE=* rake resque:workers |
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
| MyApplication::Application.routes.draw do | |
| mount Resque::Server.new, :at => "/resque" | |
| 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
| */50 * * * * /bin/bash cd /rails/root/ && rake calculate::pi > /dev/null 2>&1 |