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
asdf |
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> | |
@interface metadataRetriever : NSObject | |
+ (NSDictionary *)metadataForFile:(NSString *)filePath; | |
+ (NSData *)id3TagForFile:(NSString *)filePath; | |
@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
require "./with_message.rb" | |
MyError = StandardError.with_message "This is my error message" | |
raise MyError # the raised error's message is "This is my error message" | |
raise MyError, "Something else" # the raised error's message is "Something else" |
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 <MapKit/MapKit.h> | |
typedef void (^MapViewRendererCallback)(UIImage *image); | |
@interface MapViewRenderer : NSObject | |
+ (void)renderMapRect:(MKMapRect *)mapRect withSize:(CGSize)size completion:(MapViewRendererCallback)block; | |
@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
#!/usr/bin/env ruby | |
s = eval(File.read(Dir.glob("*.gemspec").first)) | |
app_name = s.name | |
gem_name = "#{s.name}-#{s.version}.gem" | |
task :clean do | |
`[ -f #{gem_name} ] && rm #{gem_name}` | |
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
#!/usr/bin/env ruby | |
require "digest/md5" | |
module DPKG | |
def self.control(deb_package_path) | |
return `ar p #{deb_package_path} control.tar.gz | tar -xzO` | |
end | |
class ScanPackages | |
def self.scan(path) |
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)artworksForFileAtPath:(NSString *)path block:(void(^)(NSArray *artworkImages))block { | |
NSURL *url = [NSURL fileURLWithPath:path]; | |
AVURLAsset *asset = [AVURLAsset URLAssetWithURL:url options:nil]; | |
NSArray *keys = [NSArray arrayWithObjects:@"commonMetadata", nil]; | |
[asset loadValuesAsynchronouslyForKeys:keys completionHandler:^{ | |
NSArray *artworks = [AVMetadataItem metadataItemsFromArray:asset.commonMetadata withKey:AVMetadataCommonKeyArtwork keySpace:AVMetadataKeySpaceCommon]; | |
NSMutableArray *artworkImages = [NSMutableArray array]; | |
for (AVMetadataItem *item in artworks) { |