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/sh -e | |
ROOTDIR="n900-chroot" | |
PACKAGES="ifupdown,openssh-server,udev,procps,netbase,vim,console-setup-mini,man-db,iproute" | |
PACKAGES="$PACKAGES,module-init-tools,wget,openssh-client,locales,sysklogd,klogd,input-utils,dnsutils" | |
PACKAGES="$PACKAGES,alsa-base,ntpdate,debconf-english,screen,less,console-tools,iputils-ping,vpnc,rsync" | |
PACKAGES="$PACKAGES,i2c-tools,watchdog" | |
cdebootstrap --flavour=minimal --include=$PACKAGES sid "$ROOTDIR" |
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
@implementation NSURLConnection (Timeout) | |
+ (dispatch_queue_t)timeoutLockQueue { | |
static dispatch_queue_t queue; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
queue = dispatch_queue_create("timeout lock queue", DISPATCH_QUEUE_SERIAL); | |
}); | |
return queue; | |
} |
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
void DrawInsetBeveledRoundedRect( CGContextRef context, CGRect rect, CGFloat radius, UIColor *fillColor ) | |
{ | |
//contract the bounds of the rectangle in to account for the stroke | |
CGRect drawRect = CGRectInset(rect, 1.0f, 1.0f); | |
//contract the height by 1 to account for the white bevel at the bottom | |
drawRect.size.height -= 1.0f; | |
//Save the current state so we don't persist anything beyond this operation | |
CGContextSaveGState(context); |
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
#!/usr/bin/env objc-run | |
@import Foundation; | |
@interface NSBlock // bite me | |
@end | |
@implementation NSBlock (invoke) | |
- (void) invoke | |
{ |
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
// | |
// UIResponder+FTAdditions.h | |
// Streets | |
// | |
// Created by Ortwin Gentz on 09.05.16. | |
// Copyright © 2016 FutureTap. All rights reserved. | |
// | |
#import <UIKit/UIKit.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
#import <Foundation/Foundation.h> | |
#import <libkern/OSAtomic.h> | |
@interface NSArray (ConcurrentMap) | |
- (NSArray*)semaphore_map:(id (^)(id))block; | |
- (NSArray*)serial_map:(id (^)(id))block; | |
- (NSArray*)spinlock_map:(id (^)(id))block; | |
@end | |
@implementation NSArray (ConcurrentMap) |
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
#import <Foundation/Foundation.h> | |
@interface UIView (ActivityIndicator) | |
- (void)showActivityIndicator; | |
- (void)showActivityIndicatorWithStyle:(UIActivityIndicatorViewStyle)style; | |
- (void)hideActivityIndicator; | |
@end |
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
// @property (nonatomic, strong) NSArray *colors; | |
// macro from https://gist.github.com/uechi/7688152 | |
//RGB color macro | |
#define UIColorFromRGB(rgbValue) [UIColor \ | |
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ | |
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ | |
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] |
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
- (id) initWithCoder:(NSCoder*) coder { | |
if (self = [super initWithCoder:coder]) { | |
self.backgroundView = [self createBackgroundViewWithBackgroundColor:[UIColor clearColor]]; | |
self.selectedBackgroundView = [self createBackgroundViewWithBackgroundColor:[UIColor colorWithWhite:57.0f/255.0f alpha:1.0f]]; | |
} | |
return self; | |
} | |
- (UIView*) createBackgroundViewWithBackgroundColor:(UIColor*) backgroundColor { | |
UIView* backgroundView = [[UIView alloc] initWithFrame:self.bounds]; |
OlderNewer