Skip to content

Instantly share code, notes, and snippets.

View Mikoangelo's full-sized avatar

Mikael Høilund Mikoangelo

  • Meta.io
  • Denmark
View GitHub Profile
require 'door'
describe Door do
before(:each) do
@door = Door.new
end
it "should be FUCKING AWESOME" do
Door.should be_awesome
end
>> class Array
>> def each
>> puts "each called"
>> end
>> end
=> nil
>> for foo in [1,2,3]
>> nil
>> end
each called
>> for a in [1,2,3]
>> b = a * 3
>> end
=> [1, 2, 3]
>> [a,b]
=> [3, 9]
>> [1,2,3].each do |c|
?> d = c * 3
>> end
=> [1, 2, 3]
Rehearsal ----------------------------------------
for 2.490000 0.030000 2.520000 ( 2.947099)
each 2.630000 0.030000 2.660000 ( 3.169486)
------------------------------- total: 5.180000sec
user system total real
for 2.510000 0.030000 2.540000 ( 3.117419)
each 2.630000 0.040000 2.670000 ( 3.330009)
class String
ACCENTS = {
"a" => %w{ ã á â },
"e" => %w{ é ê },
"i" => %w{ í },
"o" => %w{ õ ó ô },
"u" => %w{ ú },
"c" => %w{ ç }
}
def to_ascii!
INDENT_STRING = " "
def ph hash, indent = 0
result = "{\n"
hash.sort_by{|e|e.inspect}.each do |key, value|
result << INDENT_STRING * (indent+1)
value = if Hash === value
ph value, indent + 1
else
value.inspect
Upon clicking on Register New Account for Gadu-Gadu, Adium 1.3b11:
(the stdin/stdout flow is a bit messed up for some reason)
b '-[AIWiredString initWithString:]'
2008-08-12 02:32:26.333 Adium[1205:813] *** Assertion failure in -[AIWiredString initWithString:], /Users/adium/adium-1.3/Frameworks/AIUtilities Framework/Source/AIWiredString.m:178
Breakpoint 1, 0x962e70d7 in objc_exception_throw ()
(gdb) b '-[AIWiredString initWithString:]'
Breakpoint 2 at 0x2971ab
/bin/sh -c /Users/mikael/Git-pulls/adium/build/Adium.build/Deployment-Debug/Adium.build/Script-345DFF4A05564DB200CEE7B3.sh
** BUILD FAILED **
The following build commands failed:
Facebook:
PBXCp build/Deployment-Debug/Facebook.AdiumPlugin/Contents/Frameworks/JSON.framework build/Development/JSON.framework
Adium:
PBXCp build/Deployment-Debug/Adium.app/Contents/Frameworks/AIUtilities.framework build/Development/AIUtilities.framework
(2 failures)
require 'rubygems'
require 'stringray'
class String
include StringRay
# Constantizes a string, changing it from snake_case or 'space case' to
# TitleCase, however necessary
def constantize
str = self
require 'rubygems'
require 'stringray'
class String
include StringRay
# Constantizes a string, changing it from snake_case or 'space case' to
# TitleCase, however necessary
def constantize
str = self