View gist:5455142
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
await | |
retrieveUsers( | |
() -> defer users | |
) |
View gist:5455145
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
await | |
retrieveUsers( | |
(users) -> defer users | |
) |
View gist:6026087
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 <MobileCoreServices/MobileCoreServices.h> | |
#import <AssetsLibrary/AssetsLibrary.h> | |
#import "TTVideo.h" | |
#define BYTES_PER_PIXEL 4 | |
@interface TTVideo () | |
// Redeclared as readwrite so that we can write to the property and still be atomic with external readers. | |
@property (readwrite, nonatomic) Float64 videoFrameRate; |
View gist:8359616
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
- (NSString *):(id)a { | |
return [self stringByAppendingString:[a description]]; | |
} | |
- (NSString *):(id)a :(id)b { return [[self:a]:b];} | |
- (NSString *):(id)a :(id)b :(id)c | |
{ return [[[self:a]:b]:c]; } | |
View gist:8927113
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
-(NSArray*)objectForKeyedSubscript:(NSString*)pattern | |
{ | |
NSError *error; | |
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:&error]; | |
NSAssert( ! error, @"regex processing error"); | |
NSMutableArray *strings = [NSMutableArray new]; | |
NSArray *matches = [regex matchesInString:self options:0 range:self.fullRange]; | |
for(NSTextCheckingResult *match in matches) { | |
for (NSInteger i = 0; i < match.numberOfRanges; i++) { |
View gist:9299967
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
6458a13 HEAD@{0}: rebase -i (finish): returning to refs/heads/master | |
6458a13 HEAD@{1}: rebase -i (start): checkout HEAD~3 | |
d5a01b2 HEAD@{2}: rebase -i (finish): returning to refs/heads/master | |
d5a01b2 HEAD@{3}: rebase -i (start): checkout HEAD~2 | |
d5a01b2 HEAD@{4}: commit: created os x project, moved everything from before to ruby folder | |
102eb7e HEAD@{5}: commit: created os x program | |
6458a13 HEAD@{6}: commit: debugging image export | |
ea72280 HEAD@{7}: commit: starting with code generation | |
be49753 HEAD@{8}: commit: working on javascript stuff, very slow | |
a687e4b HEAD@{9}: commit: finished .dfont and .ttc, as well as everything but UIView, UITableViewCell, and UICollectionViewCell |
View gist:bf8b4b6162d841ee80a7
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
func generatorInclude<T, Y: Sequence where T: Equatable, T == Y.GeneratorType.Element>(seq: Y, element: T) -> Bool { | |
for e in seq { | |
if e == element { | |
return true | |
} | |
} | |
return false | |
} | |
extension Array { |
View gist:6d0f2cb942f22c24b130
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 'nokogiri' | |
if ARGV.size < 1 | |
puts "please enter the file to use" | |
exit 1 | |
end | |
storyboard = Nokogiri::XML(IO.read(ARGV[0]), &:noblanks).root | |
labels = storyboard.xpath("//label") | |
labels.each do |label| |
View gist:b40220147c9629d80550
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 'nokogiri' | |
require 'pry-byebug' | |
if ARGV.size < 1 | |
puts "please enter the file to use" | |
exit 1 | |
end | |
storyboard = Nokogiri::XML(IO.read(ARGV[0]), &:noblanks).root | |
views = storyboard.xpath("//subviews/*") + storyboard.xpath("//view") |
View gist:55a646cde6de27154ccc
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
func pollutionFromStartDate(startDate: NSDate, toEndDate:NSDate) -> Double { | |
if (readings.count == 0) { | |
return 0 | |
} | |
let totalPollution = 0 | |
if (startDate < readings.first()!.date) { | |
totalPollution += readings.first()!.pollutionLevel * (readings.first()!.date - startDate) | |
} |
OlderNewer