View asicon.sh
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
#!/bin/bash | |
# According to https://developer.apple.com/library/ios/#qa/qa1686/_index.html | |
# Install ImageMagick with MacPort: sudo port install ImageMagick | |
# Install ImageMagick with Homebrew: brew install ImageMagick | |
# Assume source icon is 1024x1024 | |
blur0="" | |
blur3="-gaussian-blur 3x3" | |
blur4="-gaussian-blur 4x4" | |
blur7="-gaussian-blur 7x7" | |
blur8="-gaussian-blur 8x8" |
View gist:4717701
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 *a = @[@"Hello", @"Will This work?", @"can it work?", @"Yes!"]; | |
// sure, this works... | |
NSMutableArray *b = [NSMutableArray arrayWithCapacity:[a count]]; | |
[a enumerateObjectsUsingBlock: ^(id obj, NSUInteger idx, BOOL *stop) { | |
[b insertObject: [obj uppercaseString] atIndex: idx]; | |
}]; |
View gist:4690180
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
_reachability = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:@"http://api.rdio.com/"]]; | |
[_reachability setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { | |
switch (status) { | |
case AFNetworkReachabilityStatusNotReachable: | |
[self.reachabilityDelegate networkIsReachable:NO]; | |
break; | |
case AFNetworkReachabilityStatusReachableViaWiFi: | |
case AFNetworkReachabilityStatusReachableViaWWAN: | |
[self.reachabilityDelegate networkIsReachable:YES]; | |
break; |
View PlaylistItem.m
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
#define CORNER_RADIUS 10 | |
- (void)drawRect:(CGRect)rect { | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextSetRGBFillColor(context, 0.0, 0.0, 0.0, 0.5); // black | |
if ([type isEqualToString:@"top"]) { // curved top | |
CGContextBeginPath (context); | |
CGContextMoveToPoint(context, 0, self.frame.size.height); // start: bottom-left |
View DoubleLabel.h
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
// | |
// DoubleLabel.h | |
// LongTermTimer | |
// | |
// Created by Jason Moore on 11-05-31. | |
// Copyright 2011 xinsight. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |