git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
// | |
// UIDeviceHardware.h | |
// | |
// Used to determine EXACT version of device software is running on. | |
#import <Foundation/Foundation.h> | |
@interface UIDeviceHardware : NSObject | |
- (NSString *) platform; |
/* | |
UIImage+AverageColor.m | |
Copyright (c) 2010, Mircea "Bobby" Georgescu | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright | |
notice, this list of conditions and the following disclaimer. |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
+ (UIColor *) colorFromHexCode:(NSString *)hexString { | |
NSString *cleanString = [hexString stringByReplacingOccurrencesOfString:@"#" withString:@""]; | |
if([cleanString length] == 3) { | |
cleanString = [NSString stringWithFormat:@"%@%@%@%@%@%@", | |
[cleanString substringWithRange:NSMakeRange(0, 1)],[cleanString substringWithRange:NSMakeRange(0, 1)], | |
[cleanString substringWithRange:NSMakeRange(1, 1)],[cleanString substringWithRange:NSMakeRange(1, 1)], | |
[cleanString substringWithRange:NSMakeRange(2, 1)],[cleanString substringWithRange:NSMakeRange(2, 1)]]; | |
} | |
if([cleanString length] == 6) { | |
cleanString = [cleanString stringByAppendingString:@"ff"]; |
+ (UIImage *)imageWithColor:(UIColor *)color andBounds:(CGRect)imgBounds { | |
UIGraphicsBeginImageContextWithOptions(imgBounds.size, NO, 0); | |
[color setFill]; | |
UIRectFill(imgBounds); | |
UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
return img; | |
} |
# You have to restart the core audio be pasting the following line into termnal | |
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'` |
I wanted to document the process that I went through to compile taglib for my iOS project. | |
At the time of this writing I used TagLib 1.9.1 | |
1. Download taglib at: http://taglib.github.io/ | |
2. Download ios-make at: github.com/plenluno/ios-cmake | |
3. The ios-make file that you need is in the toolchain directory. Copy the whole directory “toolchain” from inside the ios-make directory to taglib directory. |
/** | |
Usage: | |
let originalImage = UIImage(named: "cat") | |
let tintedImage = originalImage.tintWithColor(UIColor(red: 0.9, green: 0.7, blue: 0.4, alpha: 1.0)) | |
*/ | |
extension UIImage { | |
func tintWithColor(color:UIColor)->UIImage { |
First up, let's make Sublime Text 2 available from the command line in terminal, by creating a link to subl
which is the launcher from terminal:
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime
(added bonus of this approach is when you upgrade to ST3 or change text editor, you can just redirect the symlink).
If there's any chance that bash
doesn't check usr/local/bin
then use [Launch Sublime Text 2 from Mac OSX Terminal] for more detailed instructions on how to make this happen.
import UIKit | |
import AVFoundation | |
class ViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate { | |
@IBOutlet weak var myView: UIView! | |
var session: AVCaptureSession? | |
var device: AVCaptureDevice? | |
var input: AVCaptureDeviceInput? |