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 Array | |
| def random_element | |
| self[Random.rand(length)] | |
| end | |
| end | |
| namespace :events do | |
| desc "Do stuff every hour" | |
| task every_hour: :environment do |
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
| [self observe:UIDeviceOrientationDidChangeNotification on:@selector(orientationChanged:)]; |
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
| - (NSPredicate *)predicateFromSearchOptions:(SearchOptions *)searchOptions { | |
| NSMutableArray *formatParts = [NSMutableArray array]; | |
| NSMutableArray *args = [NSMutableArray array]; | |
| // viewport | |
| [formatParts addObjectsFromArray:@[ | |
| @"latitude >= %@", | |
| @"latitude <= %@", | |
| @"longitude >= %@", | |
| @"longitude <= %@" |
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 'open-uri' | |
| require 'net/http' | |
| threads = [] | |
| target = "http://www.mindcoding.ro/" | |
| boom_time = Time.new + 5 | |
| puts "boom time = #{boom_time}" |
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
| content = "Titlu stiintific: , Forma de exercitare a profesiei: CI, Modalitatea de exercitare a profesiei: T | |
| Sediul profesional secundar: , Birou de lucru: | |
| Telefon fix: , Telefon mobil: 0723384846, Fax: , E-mail: | |
| Sediul profesional secundar: , Birou de lucru: | |
| Telefon fix: 0263684846, Telefon mobil: 0723384846, Fax: , E-mail: | |
| 0723384 | |
| 0723384846 | |
| 072338484 |
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 Tank { | |
| class var bonusDamage: Double { | |
| return Double(Upgrade.level) * 2.5 | |
| } | |
| let baseDamage = 10.0 | |
| var damage: Double { | |
| return self.baseDamage + Tank.bonusDamage | |
| } |
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
| def filterX(image, region): | |
| return 1.0 | |
| def filterY(image, region): | |
| return 2.0 | |
| _filters = { | |
| "principalComponentX" : filterX, | |
| "principalComponentY" : filterY |
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 'watir' | |
| require 'watir-webdriver' | |
| require 'nokogiri' | |
| # require 'os' | |
| require 'json' | |
| query_string = ARGV[0] | |
| # if OS.linux? | |
| # # no more ui |
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 A { | |
| } | |
| class B { | |
| } | |
| var factory: [String:()->(AnyObject)] = [ | |
| "A" : { |
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
| var n = 12 | |
| var bile = [3, 4, 6, 7, 8, 9, 2, 1, 10, 18, 22, 26] | |
| var extrase = [2, 9, 3, 4, 22, 6] | |
| extrase.sort(<) | |
| bile.sort(<) | |
| var minBall = extrase[0] |