Skip to content

Instantly share code, notes, and snippets.

@iamcam
iamcam / gist:977906
Created May 18, 2011 02:48
Fix the second (non) tap on AQGridView item
- (void) _userSelectItemAtIndex: (UserSelectItemIndexParams*) params
{
NSUInteger index = params.indexNum;
NSUInteger numFingersCount = params.numFingers;
[self unhighlightItemAtIndex: index animated: NO];
if ( ([[self cellForItemAtIndex: index] isSelected]) && (self.requiresSelection == NO) ){
[self _deselectItemAtIndex: index animated: NO notifyDelegate: YES];
// [self _selectItemAtIndex: index animated: NO scrollPosition: AQGridViewScrollPositionNone notifyDelegate: YES
// numFingersTouch: numFingersCount];
NSLog(@"YES");
@iamcam
iamcam / gist:3189094
Created July 27, 2012 16:48
Image Picker Rotation
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
NSLog(@"Info: %@", info);
UIImage *img = [info objectForKey:UIImagePickerControllerEditedImage];
UIImage* originalImg = [self scaleAndRotateImage:[info objectForKey:UIImagePickerControllerOriginalImage]];
/*** OPTION 1 - JUST USE THE "FULL SIZE" IMAGE FROM THE PICKER CONTROLLER ***/
// [self usePhoto:originalImg];
@iamcam
iamcam / BuildPhase1.sh
Last active August 29, 2015 14:18
Automate iOS + WatchKit extension build numbers w/ Git
if [ ${CONFIGURATION} == "AppStore" ]; then
buildNumber=$(git rev-list HEAD | wc -l | tr -d ' ')
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName/AppName-Info.plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName WatchKit App/Info.plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName WatchKit Extension/Info.plist"
fi;
if [ ${CONFIGURATION} == "Release" ]; then
buildNumber=$(git rev-list HEAD | wc -l | tr -d ' ')
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName/AppName-Info.plist"
debian@beaglebone:~/Development/delete/Perfect-Net$ swift build
Compile Swift Module 'PerfectThread' (2 sources)
/home/debian/Development/delete/Perfect-Net/Packages/PerfectThread-0.9.0/Sources/ThreadQueue.swift:214:59: error: 'fromOpaque' is unavailable: use 'fromOpaque(_: UnsafePointer<Void>)' instead
let unleakyObject = Unmanaged<IsThisRequired>.fromOpaque(OpaquePointer(p)).takeRetainedValue()
^~~~~~~~~~
Swift.Unmanaged<Instance>:3:24: note: 'fromOpaque' has been explicitly marked unavailable here
public static func fromOpaque(_ value: OpaquePointer) -> Unmanaged<Instance>
^
/home/debian/Development/delete/Perfect-Net/Packages/PerfectThread-0.9.0/Sources/ThreadQueue.swift:214:59: error: 'fromOpaque' is unavailable: use 'fromOpaque(_: UnsafePointer<Void>)' instead
let unleakyObject = Unmanaged<IsThisRequired>.fromOpaque(OpaquePointer(p)).takeRetainedValue()