Skip to content

Instantly share code, notes, and snippets.

View aaronwardle's full-sized avatar

Aaron Wardle aaronwardle

View GitHub Profile
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
$config=array();
$config["hostname"] = "my-hostname-with-magento.com";
$config["login"] = "soapuser";
$config["password"] = "soappassword";
$config["customer_as_guest"] = TRUE;
$config["customer_id"] = 261; //only if you don't want as Guest
# 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
aaronwardle / gist:49ad2ecb7227936d1bb2c49b798d0dc6
Created August 23, 2016 11:30 — forked from DenTelezhkin/gist:beab675d853fcd2fd464
Multipart-form PUT request for image upload. NSURLSession, iOS 7
+(void)uploadUserPhoto:(UIImage *)image
success:(void (^)(void))success
failure:(FailureBlock)failure
{
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
aaronwardle / eloquent.md
Created February 2, 2017 13:45 — forked from msurguy/eloquent.md
Laravel 4 Eloquent Cheat Sheet.

Conventions:

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';

iPhone
iPhone 4S
FRONT camera
AVCaptureSessionPresetPhoto = 640x480
AVCaptureSessionPresetHigh = 640x480
AVCaptureSessionPresetMedium = 480x360
AVCaptureSessionPresetLow = 192x144
AVCaptureSessionPreset640x480 = 640x480
AVCaptureSessionPreset1280x720 = not supported
@aaronwardle
aaronwardle / Realm+CascadeDeleting.swift
Created September 9, 2018 18:59 — forked from krodak/Realm+CascadeDeleting.swift
Cascade deletion for RealmSwift
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)
}
@aaronwardle
aaronwardle / remote.md
Created June 19, 2019 13:40 — forked from Arkham/remote.md
Remote, office not required

Remote, Office Not Required

The Time is Right for Remote Work

Why work doesn't happen at work

The office during the day has become the last place people want to be when then really want to get work done.

Offices have become interruption factories: it's just one interruption after