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 '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 |
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 WDI | |
| #setter | |
| def name=name | |
| @name = name | |
| end | |
| #getter | |
| def name | |
| @name |
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
| { | |
| "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" | |
| ], |
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 Player | |
| def initialize birthdate | |
| @birthdate = birthdate | |
| end | |
| def is_old_enough? | |
| birthdate < Date.today-18.years | |
| end | |
| 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
| +- Views | |
| +- layout | |
| +- application | |
| +- mysite | |
| +- index | |
| +- first page | |
| +- second page |
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 AppDelegate | |
| def application(application, didFinishLaunchingWithOptions:launchOptions) | |
| alert = UIAlertView.new | |
| alert.message = "Hello World!" | |
| alert.show | |
| true | |
| end | |
| end |
NewerOlder