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
| >> str = "This is a test string" | |
| => "This is a test string" | |
| >> str1 = str.dup | |
| => "This is a test string" | |
| >> str1 = "Another string" | |
| => "Another string" | |
| >> str | |
| => "This is a test string" | |
| >> arr = [1, 2, 3] |
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
| >> arr = [[4, 5, 6], 2, 3] | |
| => [[4, 5, 6], 2, 3] | |
| >> arr1 = arr.dup | |
| => [[4, 5, 6], 2, 3] | |
| >> arr1[0] => [4, 5, 6, 7] | |
| >> arr1 | |
| => [[4, 5, 6, 7], 2, 3] | |
| >> arr | |
| => [[4, 5, 6, 7], 2, 3] |
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
| >> arr = [[4, 5, 6], 2, 3] | |
| => [[4, 5, 6], 2, 3] | |
| >> arr1 = Marshal.load(Marshal.dump(arr)) | |
| => [[4, 5, 6], 2, 3] | |
| >> arr1[0] => [4, 5, 6, 7] | |
| >> arr1 | |
| => [[4, 5, 6, 7], 2, 3] | |
| >> arr | |
| => [[4, 5, 6], 2, 3] |
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
| Index: GTLog.m | |
| =================================================================== | |
| --- GTLog.m (revision 13) | |
| +++ GTLog.m (working copy) | |
| @@ -905,7 +905,7 @@ | |
| newLines = [[ aNotification object ] availableData ]; | |
| } | |
| } | |
| - newLinesString = [[ NSString alloc ] initWithData: newLines encoding:NSASCIIStringEncoding ]; | |
| + newLinesString = [[ NSString alloc ] initWithData: newLines encoding:NSUTF8StringEncoding ]; |
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
| function sum() { | |
| var sum = 0; | |
| for( var i =0; i sum += arguments[i]; | |
| } | |
| return sum; | |
| } | |
| sum(1,2,3,4,5); // -> 15 | |
| var array = [1,2,3,4,5]; | |
| sum.apply(null, array); // -> 15 |
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
| module Foo | |
| class Bar | |
| def self.baz | |
| puts 'In Foo::Bar' | |
| end | |
| end | |
| end | |
| >> Foo::Bar.baz # => In Foo::Bar |
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
| VALUE object_klass = rb_const_get(rb_cObject, rb_intern("Foo::Bar")); | |
| rb_funcall(object_klass, rb_intern("baz"), 0); |
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
| VALUE module_klass = rb_const_get(rb_cObject, rb_intern("Foo")); | |
| VALUE object_klass = rb_const_get(module_klass, rb_intern("Bar")); | |
| rb_funcall(object_klass, rb_intern("baz"), 0); |
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
| common: | |
| support_email: [email protected] | |
| root_url: myhost.com | |
| photos_max_number: 6 | |
| production: | |
| email_exceptions: true | |
| development: | |
| root_url: localhost:3000 |
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
| namespace :translations do | |
| desc "Show available locales" | |
| task :available => :environment do | |
| puts "Available locales: #{I18n.available_locales.join(', ')}" | |
| end | |
| desc "Show missed translations depending on default language environment (:#{I18n.default_locale} by default). You can change it providing LOCALE argument" | |
| task :missed => :environment do | |
| locale = ENV['LOCALE'] || I18n.default_locale | |
| puts "Using :#{locale} as default locale" |