Skip to content

Instantly share code, notes, and snippets.

View gist:8d3069e6ebb90c79783a9cf19efdc456
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()
@iamcam
iamcam / BuildPhase1.sh
Last active Aug 29, 2015
Automate iOS + WatchKit extension build numbers w/ Git
View BuildPhase1.sh
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"
@iamcam
iamcam / gist:3189094
Created Jul 27, 2012
Image Picker Rotation
View gist:3189094
-(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 / gist:977906
Created May 18, 2011
Fix the second (non) tap on AQGridView item
View gist:977906
- (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");