Skip to content

Instantly share code, notes, and snippets.

View geraudmathe's full-sized avatar

gerry geraudmathe

View GitHub Profile
require 'benchmark'
n = 1000000
Benchmark.bm do |x|
x.report("Calling {} ") do
n.times{ hash = {} }
end
x.report("Calling Hash.new") do
n.times{ hash = Hash.new }
end
class WDI
#setter
def name=name
@name = name
end
#getter
def name
@name
{
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
".gitkeep",
"dump.rdb"
],
class Player
def initialize birthdate
@birthdate = birthdate
end
def is_old_enough?
birthdate < Date.today-18.years
end
end
@geraudmathe
geraudmathe / locomotive-fundamentals-classic-tree
Created May 19, 2012 09:34
locomotive fundamentals classic-tree
+- Views
+- layout
+- application
+- mysite
+- index
+- first page
+- second page
@geraudmathe
geraudmathe / helloworld-rbmotion.rb
Created May 15, 2012 07:17
helloworld with rubymotion
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
alert = UIAlertView.new
alert.message = "Hello World!"
alert.show
true
end
end