Skip to content

Instantly share code, notes, and snippets.

Aaron Wardle aaronwardle

Block or report user

Report or block aaronwardle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
aaronwardle / sharedButtonCode
Last active Dec 18, 2015
UIActivityViewController Example
View sharedButtonCode
- (void)shareButtonClicked {
//-- set strings and URLs
NSString *textObject = @"Information that I want to tweet or share";
NSString *urlString = [NSString stringWithFormat:@"http://www.mygreatdomain/%@", _selectedPageString];
NSURL *url = [NSURL URLWithString:urlString];
NSArray *activityItems = [NSArray arrayWithObjects:textObject, url, nil];
//-- initialising the activity view controller
View gist:7506442
ini_set("display_errors", 1);
$config["hostname"] = "";
$config["login"] = "soapuser";
$config["password"] = "soappassword";
$config["customer_as_guest"] = TRUE;
$config["customer_id"] = 261; //only if you don't want as Guest
View ios_sizes.txt
# Splash screens
Splash screens iPhone iOS 6 and 7:
320 x 480 / 640 x 960 (3.5”)
320 x 568 / 640 x 1136 (4”)
Splash screen iPad iOS 6:
768 x 1004 / 1536 x 2008 (portrait)
1024 x 748 / 2048 x 1496 (landscape)
aaronwardle / xcode .gitignore
Created Feb 13, 2014
GitIgnore Template for Xcode Projects
View xcode .gitignore
# Xcode
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php
#Redirect an entire site:
Redirect 301 /
#Redirect an entire site to a sub folder
Redirect 301 /
aaronwardle / gist:49ad2ecb7227936d1bb2c49b798d0dc6
Created Aug 23, 2016 — forked from DenTelezhkin/gist:beab675d853fcd2fd464
Multipart-form PUT request for image upload. NSURLSession, iOS 7
View gist:49ad2ecb7227936d1bb2c49b798d0dc6
+(void)uploadUserPhoto:(UIImage *)image
success:(void (^)(void))success
GTSessionManager * manager = [GTSessionManager manager];
NSString* tmpFilename = [NSString stringWithFormat:@"%f", [NSDate timeIntervalSinceReferenceDate]];
NSURL* tmpFileUrl = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:tmpFilename]];
NSString * query = [NSString stringWithFormat:@"%@user?auth_token=%@",[manager.baseURL absoluteString],[[UserManager shared] authToken]];
aaronwardle /
Created Feb 2, 2017 — forked from msurguy/
Laravel 4 Eloquent Cheat Sheet.


Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';

View iPhone iPad Camera Presets
iPhone 4S
FRONT camera
AVCaptureSessionPresetPhoto = 640x480
AVCaptureSessionPresetHigh = 640x480
AVCaptureSessionPresetMedium = 480x360
AVCaptureSessionPresetLow = 192x144
AVCaptureSessionPreset640x480 = 640x480
AVCaptureSessionPreset1280x720 = not supported
aaronwardle / PDF
Created Nov 7, 2017
Generates a PDF from tableview
View PDF
if #available(iOS 10.0, *) {
let priorBounds = tableView.bounds
let fittedSize = tableView.sizeThatFits(CGSize(width:priorBounds.size.width, height:tableView.contentSize.height))
tableView.bounds = CGRect(x:0, y:0, width:fittedSize.width, height:fittedSize.height)
let pdfPageBounds = CGRect(x:0, y:0, width:tableView.frame.width, height:self.view.frame.height)
let dir = FileManager.default.urls(for: FileManager.SearchPathDirectory.cachesDirectory, in: FileManager.SearchPathDomainMask.userDomainMask).first!
let fileurl = dir.appendingPathComponent("test.pdf")
View Realm+CascadeDeleting.swift
import RealmSwift
import Realm
protocol CascadeDeleting: class {
func delete<Entity>(_ list: List<Entity>, cascading: Bool)
func delete<Entity>(_ results: Results<Entity>, cascading: Bool)
func delete<Entity: Object>(_ entity: Entity, cascading: Bool)
You can’t perform that action at this time.