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 Foo | |
| attr_accessor :bar | |
| def set | |
| @bar = "set in the set method" | |
| end | |
| def check | |
| p bar | |
| bar = "set locally" |
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
| mysql> SET SESSION sql_mode = 'ANSI,NO_BACKSLASH_ESCAPES,NO_DIR_IN_CREATE,NO_ENGINE_SUBSTITUTION,NO_UNSIGNED_SUBTRACTION,TRADITIONAL'; | |
| Query OK, 0 rows affected (0.00 sec) | |
| mysql> ALTER TABLE `urls` ADD COLUMN `cached_at` DATETIME; | |
| ERROR 1292 (22007): Incorrect datetime value: '0000-00-00 00:00:00' for column 'updated_at' at row 18 | |
| mysql> |
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
| #!/usr/bin/env ruby | |
| module Mixin | |
| def self.included(mod) | |
| mod.extend ClassMethods | |
| end | |
| module ClassMethods |
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
| * Event conditions are not available for your installation of god. | |
| * You may still use and write custom conditions using the poll system | |
| * | |
| *********************************************************************** | |
| I [2011-06-22 08:22:07] INFO: Syslog disabled. | |
| I [2011-06-22 08:22:07] INFO: Using pid file directory: /home/ubuntu/.god/pids | |
| I [2011-06-22 08:22:07] INFO: Socket already in use | |
| I [2011-06-22 08:22:07] INFO: Socket is stale, reopening | |
| I [2011-06-22 08:22:07] INFO: Started on drbunix:///tmp/god.17165.sock |
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 'date' | |
| require 'benchmark' | |
| puts "patchlevel: #{RUBY_PATCHLEVEL}, release_date: #{RUBY_RELEASE_DATE}, ruby_version: #{RUBY_VERSION}, ruby_platform: #{RUBY_PLATFORM}" | |
| puts '*'*80 | |
| Benchmark.bm(10) do |bm| | |
| bm.report("Date.today") do | |
| 500_000.times { Date.today } |
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
| 97,103, | |
| 97,52, | |
| 97,55, | |
| 97,90, | |
| 97,54, | |
| 97,100, | |
| 97,102, | |
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
| day = case self.type | |
| when 'fast' then :fast_completion_day | |
| when 'super_fast' then :super_fast_completion_day | |
| when 'ludicrous' then :ludicrous_completion_day | |
| else :budget_completion_day | |
| end | |
| self.value = Increment.first.max_hours * Incrementor.first.send(day) |
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 "eventmachine" | |
| module DumbHttpClient | |
| def post_init | |
| puts "* Sending..." | |
| puts | |
| send_data "GET / HTTP/1.1\r\nHost: _\r\n\r\n" | |
| puts "GET / HTTP/1.1\r\nHost: www.google.com\r\n\r\n" | |
| @data = "" |
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
| ==================================== Nodes ==================================== | |
| Node #1: 20.3% [email protected] | |
| Node #2: 19.9% [email protected] | |
| Node #3: 19.9% [email protected] | |
| Node #4: 19.9% [email protected] | |
| Node #5: 19.9% [email protected] | |
| ==================================== Ring ===================================== | |
| [1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3, | |
| 4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1, | |
| 2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4, |
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
| ===== | |
| ===== LOGGING STARTED Tue Sep 27 13:58:58 PDT 2011 | |
| ===== | |
| =ERROR REPORT==== 27-Sep-2011::13:58:56 === | |
| [{application,mochiweb},"Accept failed error","{error,emfile}"] | |
| =ERROR REPORT==== 27-Sep-2011::13:58:56 === | |
| [{application,mochiweb},"Accept failed error","{error,emfile}"] | |
| =ERROR REPORT==== 27-Sep-2011::13:58:56 === |
OlderNewer