Skip to content

Instantly share code, notes, and snippets.

View leeprobert's full-sized avatar

Lee Probert leeprobert

View GitHub Profile
@leeprobert
leeprobert / Country.plist
Created November 12, 2015 11:23
Country and State data as plist. Thanks to https://github.com/hackiftekhar/IQCountryStateHandler
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>001</key>
<string>Afghanistan</string>
<key>002</key>
<string>Albania</string>
<key>003</key>
<string>Algeria</string>
@leeprobert
leeprobert / StyleManager.swift
Last active November 5, 2015 15:00
StyleManager port to Swift 2. The class loads the plist by getting the filename from the project info.plist. The plist allows core UIKit components to be styled very easily. The StyleManager class is a Singleton and just needs to be initialised in the app delegate to style the app.
//
// StyleManager.swift
// HoboApp
//
// Created by WLD_MBP_20 on 04/11/2015.
// Copyright (c) 2015 probert. All rights reserved.
//
import UIKit
@leeprobert
leeprobert / form_kit.html
Last active August 29, 2015 14:25
A bunch of things that are useful in a HTML5 form
<!-- Regular expression for UK postcodes -->
<label for=postcode>Postcode<span class="red">*</span></label>
<input name=postcode type=text aria-required required pattern="[0-9]{5}(\-[0-9]{4})?|[a-zA-Z]{1,2}\d{1,2}\s?\d[a-zA-Z]{1,2}" placeholder="A valid UK postcode" />
<!-- to test in the browser console use: -->
/^(:?[a-zA-Z]{1,2}\d{1,2}\s?\d[a-zA-Z]{1,2})$/.test("tn12 6an")
@leeprobert
leeprobert / styles.css
Created July 21, 2015 12:28
Force webkit search input to look like a standard textfield
input[type="search"] { -webkit-appearance: textfield; }
@leeprobert
leeprobert / CoolUnitySceneViewController
Created February 10, 2015 10:45
UnityAppController subclass
//
// CoolUnitySceneViewController.m
// Unity-iPhone
//
// Created by Frederik Jacques on 06/08/14.
//
//
#import "CoolUnitySceneViewController.h"
#import "GoodByeViewController.h"
@leeprobert
leeprobert / StreetViewImageConversion
Created November 7, 2014 15:08
This bit of code will convert the StreetView getZoom() Number into the 'field of view' property you need for the StreetView Image API.
var zoom = panorama.getPov().zoom;
var fov = 180/Math.pow(2,zoom);
@leeprobert
leeprobert / footwear.plist
Created December 9, 2013 09:06
A large data set of "Footwear" that can be used to quickly mock up some data in a Table or Collection View
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>brand</key>
<string>Other</string>
<key>models</key>
<array>
<string>Not listed</string>
// Standard library
#include <stdint.h>
#include <stdio.h>
// Core Foundation
#include <CoreFoundation/CoreFoundation.h>
// Cryptography
#include <CommonCrypto/CommonDigest.h>
@leeprobert
leeprobert / AGNJSONContainerLogger.h
Created July 3, 2013 11:43
AGNJSONValidator - suite of tools for validating JSON against schemas. Also references the AGNLogging classes.
//
// AGNJSONContainerLogger.h
// Agnitio iPlanner
//
// Created by Matt Gough on 14/02/2013.
// Copyright (c) 2013 Agnitio. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "AGNContainerWalker.h"
@leeprobert
leeprobert / AGNLogging.h
Created July 3, 2013 11:34
AGNLogging - class for logging based on different priorities. Will log to a file and to the console. Requires the Lumberjack Framework : https://github.com/robbiehanson/CocoaLumberjack
//
// AGNLogging.h
// Agnitio iPlanner
//
// Created by Matt Gough on 14/02/2013.
// Copyright (c) 2013 Agnitio. All rights reserved.
//
#import <Foundation/Foundation.h>