Skip to content

Instantly share code, notes, and snippets.

View veritech's full-sized avatar

Jonathan Dalrymple veritech

View GitHub Profile
@veritech
veritech / currentLocation.swift
Created May 13, 2017 16:41
Current location experiment
//
// ViewController.swift
// CurrentLocation
//
// Created by Jonathan Dalrymple on 13/05/2017.
// Copyright © 2017 float-right. All rights reserved.
//
import UIKit
import GoogleMaps
@veritech
veritech / exampleB.swift
Last active December 8, 2016 00:23
ExampleB
class Object: NSObject {
let name:String
init(name:String) {
self.name = name
}
}
@veritech
veritech / exampleA.swift
Created December 8, 2016 00:19
Blogpost code
class Object: NSObject {
let name:String
init(name:String) {
self.name = name
}
}
func ==(lhs: Object, rhs:Object) -> Bool {
return lhs.name == rhs.name
@veritech
veritech / PGP Key
Created November 13, 2015 11:42
My public key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: GPGTools - https://gpgtools.org
mQINBFZFv3ABEADKpPf1TY/t9sGkQNOxJRBadeisl1MLNwc3OttpuG9DNuINu/fI
7WAXKyA045gWiUcIOmwSrjGL5r4Li71TT9znqczoTVOWrbxsXarfXv+pYCruuCgm
DOz0ZqvzXd/cDFPtIjMbYS9vMr6BOopSU/a66iBSoVYwt5XFUUpgZJIe19YmfLhy
UnrKqI46E1kq8utq/WfqR8z/qwUsuhHw3IwJO6Cm0xoWJ++Htught3bBUn3AmJ68
tgdgZq5O0U5bQJ0xeuD9K69CSqSklLYGMWVoeuUVX9o0qkV3xXjNMGJwGLP/bGdM
mIYrYidhx9yALrJzPpyIDsOZAp5hYjUIr8Ppu8UB8laGSJbxW2BGlwYiiNDgEmWB
sYBhthzGbyJX8UC8EOm4MPHL4S4fQLIdoaXyjoRTS3hM1AB+sDKujMBgM+SpQWBe
@veritech
veritech / make_vectors.py
Last active August 29, 2015 14:22
Make a vector xcimage set with a folder of PDF files
import os
import shutil
contentTemplate = """
{
"images" : [
{
"idiom" : "universal",
"filename" : "%s"
}
@veritech
veritech / gist:852b5cd089cf4f46503b
Created May 27, 2015 14:05
Mirror a repo, Update a remote copy, while stripping history
#!/usr/bin/env bash
SOURCE_REPO="" #ie. git@github.com:veritech/FRCoreDataOperation.git
DESTINATION_REPO="" #git@github.com:veritech/mirror.git
FORMATTED_DATE=`date +"%B %d %Y"`
# Get the head of the mirror repo
git clone $DESTINATION_REPO mirror
# Get the head of the of the source repo
config defaultToCurrentScreen true
#screens
alias mon-laptop 1680x10150
#applications
alias browser 'Google Chrome'
alias term 'Terminal'
alias editor 'TextMate'
@veritech
veritech / build.sh
Last active August 29, 2015 14:08 — forked from vls/build.sh
Building a Fat binary for polarSSL with support for arm7, arm 7s, arm64 and i386. Pulls code directly from the polar ssl github
#!/bin/bash
# Automatic build script for polarssl
# for iPhoneOS and iPhoneSimulator
#
# Created by Felix Schulze on 08.04.11.
# Copyright 2010 Felix Schulze. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
- (void)updateConstraints {
NSMutableArray *constraints = [NSMutableArray array];
NSDictionary *views;
NSDictionary *metrics = @{};
void (^squareConstraint)(UIView *) = ^(UIView *aView) {
[constraints addObject:[NSLayoutConstraint constraintWithItem:aView
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
toItem:aView
@veritech
veritech / gist:8340686
Created January 9, 2014 19:48
calculate the date at the start and end of a given week
- (NSDate *)dateAtStartOfWeek
{
NSCalendar *calendar = [NSDate AZ_currentCalendar];
NSDateComponents *components = [calendar components:NSYearCalendarUnit | NSMonthCalendarUnit | NSWeekdayCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit fromDate:self];
// NSRange range = [calendar rangeOfUnit:NSDayCalendarUnit inUnit:NSWeekdayCalendarUnit forDate:self];
components.day -= components.weekday;
return [calendar dateFromComponents:components];
}
- (NSDate *)dateAtEndOfWeek