Skip to content

Instantly share code, notes, and snippets.

@jllubia
jllubia / photoDeletionTest.m
Last active August 29, 2015 14:26
Deleting a picture with Photos framework causes a user prompt
__block PHObjectPlaceholder *assetPlaceholder = nil;
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
PHAssetChangeRequest * request = [PHAssetChangeRequest creationRequestForAssetFromImage: [UIImage imageNamed:@"icon-1024-rounded"]];
assetPlaceholder = request.placeholderForCreatedAsset;
} completionHandler:^(BOOL success, NSError *error) {
NSLog(@"creation success %d - error: %@ - place: %@", success, error, assetPlaceholder);
PHFetchResult * result = [PHAsset fetchAssetsWithLocalIdentifiers: @[assetPlaceholder.localIdentifier] options: nil];
NSLog(@"Asset fetching: %@", result);
[[PHPhotoLibrary sharedPhotoLibrary] performChanges: ^{
[PHAssetChangeRequest deleteAssets: @[result.firstObject]];
#!/bin/sh
#
# Download and install a single iOS provisioning profile
# Requires https://github.com/nomad/cupertino
#
# Usage
# - Login to your account once:
# ios login
# - Configure TEAM and PROFILE (instructions below)
# - Run update_provisioning_profile.sh at anytime, usually after adding/removing devices to the profile
#!/bin/sh
#
# Download and install a single iOS provisioning profile
# Requires https://github.com/nomad/cupertino
#
# Usage
# - Login to your account once:
# ios login
# - Configure TEAM and PROFILE (instructions below)
# - Run update_provisioning_profile.sh at anytime, usually after adding/removing devices to the profile
@jllubia
jllubia / covers.sh
Created October 7, 2011 17:36
Steve Jobs Magazine Covers from Kuo Design Download Script
for (( i=1; i<10; i++ ))
do
curl http://www.kuodesign.com/pineapple/coverme/images/large/STEVE-0$i.jpg > steve-0$i.jpg
done
for (( i=10; i<=82; i++ ))
do
curl http://www.kuodesign.com/pineapple/coverme/images/large/STEVE-$i.jpg > steve-$i.jpg
done
curl http://www.kuodesign.com/pineapple/coverme/images/large/STEVE-85.jpg > steve-83.jpg
curl http://www.kuodesign.com/pineapple/coverme/images/large/macpower.jpg > steve-84.jpg