This file contains 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 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 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 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 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 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 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
#!/usr/bin/env ruby | |
clipboard = `pbpaste` | |
if clipboard.match /https?:\/\/w?w?w?\.((youtube)|(listenonrepeat))\.com\/.*/ | |
# Youtube / Listen on repeat | |
if clipboard["youtube"] != nil | |
clipboard["youtube"] = "listenonrepeat" | |
elsif clipboard["listenonrepeat"] != nil | |
clipboard["listenonrepeat"] = "youtube" | |
end |
This file contains 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
// Invalidate a call if it's been less that 1 second since the last one | |
//===================================================================== | |
static NSDate *lastDate = nil; | |
NSDate *currentDate = [NSDate date]; | |
if (lastDate != nil && | |
[currentDate timeIntervalSinceDate:lastDate] < 1) { | |
return ; | |
} | |
lastDate = currentDate; | |
//===================================================================== |
This file contains 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
DERIVED_DATA_PATH = "~/Library/Developer/Xcode/DerivedData/" | |
def projects | |
`ls -al #{DERIVED_DATA_PATH}`.split("\n")[3..-1].map { |p| | |
ls_components = p.split(" ") | |
project_name = ls_components.last | |
if project_name != "ModuleCache" | |
project_name = project_name.split("-")[0..-2].join("-") | |
else |
This file contains 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
#import <Foundation/Foundation.h> | |
@interface NSURLRequest (cURL) | |
- (NSString *)cURLCommand; | |
@end |