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
_block BOOL found = NO; | |
[foo usingBlock:^ { | |
breakpoint here: p found —> no symbol "found" in current context. |
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
AVAsset *asset = [AVAsset assetWithURL:inputURL]; | |
NSLocale *locale = [[asset availableChapterLocales] lastObject]; | |
NSArray *keys = [NSArray arrayWithObjects:AVMetadataCommonKeyTitle, nil]; | |
NSArray *chapters = [asset chapterMetadataGroupsWithTitleLocale:locale containingItemsWithCommonKeys:keys]; | |
// Yes, we do have chapters ;-) 8... ;-) | |
AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPresetAppleM4A]; | |
exportSession.outputURL = outputURL; | |
exportSession.outputFileType = AVFileTypeAppleM4A; |
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
FYI: If you come from Google on this one... YAML is installed with Ruby... If it can be compiled! When installing 1.9.2 with "rvm install 1.9.2" | |
I stumbled upon Yaml not installing because gcc4.2 wasn't on my system. Turned out it was because Xcode 4.2 doesn't deliver GCC 4.2 anymore so | |
you'll have to either Install Xcode 4.1 (or at least the Unix tools) or install gcc by hand (or brew, or anything). | |
gem install psych | |
Building native extensions. This could take a while... | |
ERROR: Error installing psych: | |
ERROR: Failed to build gem native extension. |
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
#fake .row .left { | |
display: inline-block; | |
text-align: right; | |
width: 70px; | |
} | |
#fake .row .right { | |
display: inline-block; | |
width: 20px; | |
} |
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
.row | |
.left | |
display: inline-block | |
width: 70px | |
.right | |
display: inline-block | |
margin-left: 10px | |
width: 20px |
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
class Hash | |
def key_path(dotted_path) | |
# see http://stackoverflow.com/questions/7139471/transform-a-ruby-hash-into-a-dotted-path-key-string | |
parts = dotted_path.split '.', 2 | |
match = self[parts[0]] | |
if !parts[1] or match.nil? | |
return match | |
else | |
return match.key_path(parts[1]) | |
end |
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
21.08.11 13:54:45,295 [0x0-0x8008].com.apple.dt.Xcode: Traceback (most recent call last): | |
21.08.11 13:54:45,295 [0x0-0x8008].com.apple.dt.Xcode: File "<console>", line 1, in <module> | |
21.08.11 13:54:45,295 [0x0-0x8008].com.apple.dt.Xcode: IOError: [Errno 2] No such file or directory: '/dev/ttys012' | |
21.08.11 13:54:45,295 [0x0-0x8008].com.apple.dt.Xcode: Traceback (most recent call last): | |
21.08.11 13:54:45,295 [0x0-0x8008].com.apple.dt.Xcode: File "<console>", line 1, in <module> | |
21.08.11 13:54:45,295 [0x0-0x8008].com.apple.dt.Xcode: NameError: name 'new_stdin' is not defined | |
21.08.11 13:54:45,295 Xcode: unable to start read thread for lldb io | |
21.08.11 13:54:45,385 com.apple.debugserver-141: debugserver-141 for x86_64. | |
21.08.11 13:54:45,385 com.apple.debugserver-141: Listening to port 43409... | |
21.08.11 13:54:45,481 com.apple.debugserver-141: Got a connection, waiting for process information for launching or attaching. |
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
$(".ui-sortable tr").each(function() { | |
$($(this)).droppable({ | |
accept: "tr", | |
drop: function(e, ui) { | |
console.log('dropped'); | |
}, | |
over: function(e, ui) { | |
ui.draggable.insertAfter(this); | |
} | |
}); |
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
self.imagePickerController = [[UIImagePickerController alloc] init]; | |
[self.imagePickerController setDelegate:self]; | |
[self presentModalViewController:self.imagePickerController animated:YES]; | |
-- | |
@interface MainViewController : UIViewController <UIImagePickerControllerDelegate> { | |
-- |
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)upload:(UIImage*)image { | |
CGFloat width = [image size].width; | |
CGFloat scale = 600/width; | |
UIImage *picture = [UIImage imageWithCGImage:[image CGImage] scale:scale orientation:UIImageOrientationRight]; | |
NSLog(@"image: %@ - picture: %@", NSStringFromCGSize([image size]), NSStringFromCGSize([picture size])); | |
image: {1536, 2048} - picture: {3932.16, 5242.88} |