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
| ALAssetRepresentation *video = [asset defaultRepresentation]; | |
| NSUInteger chunkSize = 100 * 1024; | |
| uint8_t *buffer = malloc(chunkSize * sizeof(uint8_t)); | |
| long length = [video size]; | |
| NSFileHandle *file = [NSFileHandle fileHandleForWritingAtPath: videoPath]; | |
| if(file == nil) { | |
| [[NSFileManager defaultManager] createFileAtPath:videoPath contents:nil attributes:nil]; | |
| file = [NSFileHandle fileHandleForWritingAtPath:videoPath]; |
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
| $(document).ready(function(){ | |
| $(".odd").each(function() { | |
| var backgroundColor = $(this).css('background-color'); | |
| var parts = backgroundColor.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); | |
| parts.splice(0, 1); | |
| var newBackground = "rgba("+parts.join(",") + ",0.7)"; | |
| $(this).css({'background-color' : newBackground}); | |
| }); | |
| }); |
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
| #import "EntryHelper.h" | |
| #import "ImageHelper.h" | |
| #import "Image.h" | |
| @implementation EntryHelper | |
| @synthesize entry; | |
| - (NSString *)getEntryDirectoryPath{ | |
| if(entryDirectoryPath == nil) { | |
| NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); |
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
| #import <Foundation/Foundation.h> | |
| #import "Entry.h" | |
| @interface EntryHelper : NSObject { | |
| Entry *entry; | |
| @private | |
| NSString *entryDirectoryPath; | |
| } | |
| @property (nonatomic, retain) Entry *entry; | |
| - (NSString *)getEntryDirectoryPath; |
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
| #import "ImageHelper.h" | |
| #import "EntryHelper.h" | |
| @implementation ImageHelper | |
| @synthesize image; | |
| - (UIImage *)getFullScreenImage{ | |
| return [UIImage imageWithContentsOfFile:[self getFullScreenImagePath]]; | |
| } |
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
| #import <Foundation/Foundation.h> | |
| #import "Image.h" | |
| @interface ImageHelper : NSObject{ | |
| @private | |
| Image *image; | |
| } | |
| - (UIImage *)getThumbnailImage; | |
| - (UIImage *)getFullScreenImage; | |
| - (UIImage *)getOriginalImage; |
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
| #import <Foundation/Foundation.h> | |
| #import <CoreData/CoreData.h> | |
| @class Entry; | |
| @interface Image : NSManagedObject { | |
| @private | |
| UIBackgroundTaskIdentifier bgTask; | |
| } |
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
| // | |
| // Image.m | |
| // journal | |
| // | |
| // Created by Brian Clubb on 2/12/11. | |
| // Copyright (c) 2011 Bubblesort Labs LLC. All rights reserved. | |
| // | |
| #import "Image.h" | |
| #import "Entry.h" |
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
| #!/bin/sh | |
| while [ "true" ] | |
| do | |
| RESPONSE=$(curl --write-out %{http_code} --silent --output /dev/null http://developer.apple.com/devcenter/ios/index.action) | |
| if [ "$RESPONSE" -ne "302" ]; then | |
| #afplay "Finished.mp3" #uncomment the start of the line and add your own sound if you want something to play | |
| echo "It's up!!!!" | |
| fi | |
| sleep 60 |
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
| #import "UIView+Screenshot.h" | |
| @implementation UIView (Screenshot) | |
| -(UIImageView *)screenshot{ | |
| UIGraphicsBeginImageContext(self.bounds.size); | |
| [self.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
| UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); | |
| UIGraphicsEndImageContext(); |
NewerOlder