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 | |
projects = %w[CSV Caboodle Transcript Recipes Mockingbird Bindings WhatsYourFine Typewriter Specify Posit Braille Handsy] | |
# a regular expression to identify the existing header format | |
# in this case, I had been using the format from the Xcode file templates | |
existing_format = /\/\/\n\/\/ .*\n\/\/ .*\n\/\/\n\/\/.*\n\/\/.*\n\/\/\n/ | |
# the new format to replace the old | |
# in my case, I didn't want to include file names or the project name, |
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
top = Dir.pwd | |
Dir["**/*/Podfile"].each do |f| | |
dir = File.dirname(f) | |
Dir.chdir(dir) | |
puts "Installing pods for #{dir} ..." | |
system "pod install --verbose" | |
Dir.chdir top | |
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
#!/usr/bin/env ruby | |
class String | |
def starts_with?(prefix) | |
prefix = prefix.to_s | |
self[0, prefix.length] == prefix | |
end | |
end | |
old = 'RJD' # old prefix |
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
svn status --no-ignore | grep -E '(^\?)|(^\I)' | sed -e 's/^. *//' | sed -e 's/\(.*\)/"\1"/' | xargs rm -rf |
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 | |
class String | |
def starts_with?(prefix) | |
prefix = prefix.to_s | |
self[0, prefix.length] == prefix | |
end | |
end | |
old = 'RJD' # old prefix |
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
existing_format = /\/\/\n\/\/ .*\n\/\/ .*\n\/\/\n\/\/.*\n\/\/.*\n\/\/\n/ | |
new_format = <<EOF | |
// The MIT License | |
// | |
// Copyright (c) 2013 Ryan Davies | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights |
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
// grab the model: | |
NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"StoreMigration" withExtension:@"momd"]; | |
NSManagedObjectModel *managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; | |
// create a new example store type: | |
NSPersistentStoreCoordinator *csvCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:managedObjectModel]; | |
csvCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:managedObjectModel]; | |
if (![csvCoordinator addPersistentStoreWithType:[SMGCSVStore type] configuration:nil URL:csvStoreURL options:nil error:&error]) { | |
NSLog(@"Couldn't add store: %@", [error localizedDescription]); | |
abort(); |
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
CLLocationManager *locationManager = [[CLLocationManager alloc] init]; | |
[locationManager setDelegate:self]; | |
[locationManager setDesiredAccuracy:kCLLocationAccuracyHundredMeters]; | |
[self setLocationManager:locationManager]; | |
// ... | |
CLLocationCoordinate2D eiffelTowerCoordinates = CLLocationCoordinate2DMake(48.858093, 2.294694); | |
CLLocationDistance radius = 20; // 20 meters | |
CLRegion *region = [[CLRegion alloc] initCircularRegionWithCenter:eiffelTowerCoordinates radius:20.0 identifier:@"Eiffel Tower"]; |
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
UIGraphicsBeginImageContext(rect.size); | |
[view drawViewHierarchyInRect:rect afterScreenUpdates:NO]; | |
UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); |
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 UIKit; | |
@interface BlurView : UIView | |
@property (weak, nonatomic) UIView *backgroundView; | |
@end |
OlderNewer