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
// get a time stamp from a pebble time struct | |
long timestampFromTime(PblTm time) | |
{ | |
return (((time.tm_mday * 24) + time.tm_hour) * 60 + time.tm_min) * 60 + time.tm_sec; | |
} | |
long timeintervalBetweenTimes(PblTm time1, PblTm time0) | |
{ | |
long timestamp1 = timestampFromTime(time1); | |
long timestamp0 = timestampFromTime(time0); |
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
// | |
// DTSQLiteDatabase.h | |
// DTFoundation | |
// | |
// Created by Oliver Drobnik on 5/22/13. | |
// Copyright (c) 2013 Drobnik.com. All rights reserved. | |
// | |
/** | |
A wrapper for SQLite databases which offers threadsafe concurrency and support for cancelling long-running operations. |
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
// get source image | |
NSData *imageData = _picture.imageData; | |
CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)(imageData), NULL); | |
CGImageRef sourceImage = CGImageSourceCreateImageAtIndex(source, 0, NULL); | |
CFRelease(source); | |
CGRect imageRect = CGRectZero; | |
imageRect.size.width = CGImageGetWidth(sourceImage); | |
imageRect.size.height = CGImageGetHeight(sourceImage); | |
imageRect.origin.x = -imageRect.size.width/2.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
Hello <FIRST_NAME>, | |
Thank you for contacting us regarding WWDC 2013. | |
Enthusiasm for this year's conference has been incredible and tickets sold out in record time. | |
<PERSON> can still take advantage of all the great WWDC content, as we'll be posting videos of all our sessions during the conference. | |
If you have any further questions please let us know by sending an email to [email protected]. |
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
- (void)drawInRect:(CGRect)rect context:(CGContextRef)context | |
{ | |
CGContextDrawImage(context, rect, self.image.CGImage); | |
} |
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
Pod::Spec.new do |spec| | |
spec.name = 'DTLoupe' | |
spec.version = '1.3.0' | |
spec.platform = :ios, '4.3' | |
spec.license = 'COMMERCIAL' | |
spec.source = { :git => '[email protected]:parts/dtloupe.git', :tag => spec.version.to_s } | |
spec.source_files = 'Core/Source/*.{h,m}' | |
spec.frameworks = 'QuartzCore' | |
spec.requires_arc = true | |
spec.homepage = 'http://www.cocoanetics.com/parts/dtloupeview/' |
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
- (NSAttributedString *)attributedStringWithString:(NSString *)string highlightedwithOccurencesOfString:(NSString *)stringToHighlight inColor:(DTColor *)color | |
{ | |
// build an attributed string to start with | |
// font | |
DTCoreTextFontDescriptor *fontDesc = [[DTCoreTextFontDescriptor alloc] init]; | |
fontDesc.fontFamily = @"Helvetica"; | |
fontDesc.pointSize = 20; | |
// paragraph style |
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
Pod::Spec.new do |spec| | |
spec.name = 'DTLoupe' | |
spec.version = '1.3.0' | |
spec.platform = :ios, '4.3' | |
spec.license = 'COMMERCIAL' | |
spec.source = { :git => '[email protected]:parts/dtloupe.git', :tag => spec.version.to_s } | |
spec.source_files = 'Core/Source/*.{h,m}' | |
spec.frameworks = 'QuartzCore' | |
spec.requires_arc = true | |
spec.homepage = 'http://www.cocoanetics.com/parts/dtloupeview/' |
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
- (NSArray *)_picturesInDirectoryAtURL:(NSURL *)URL | |
{ | |
NSMutableArray *tmpArray = [NSMutableArray array]; | |
NSArray *keys = [NSArray arrayWithObjects: | |
NSURLIsDirectoryKey, NSURLIsPackageKey, NSURLLocalizedNameKey, nil]; | |
NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] | |
enumeratorAtURL:URL | |
includingPropertiesForKeys:keys |
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
DTHTMLWriter does not correctly encode emoji unicode sequences. | |
It outputs this: | |
Here is a Smiley: �� and Mr. Poop: �� | |
which does not display as Emoji in Safari. | |
NSHTMLWriter does not encode them at all: |