Skip to content

Instantly share code, notes, and snippets.

View lukeredpath's full-sized avatar
🏠
Working from home

Luke Redpath lukeredpath

🏠
Working from home
View GitHub Profile
extern const struct DomainRelationships {
__unsafe_unretained NSString *records;
__unsafe_unretained NSString *registrant;
__unsafe_unretained NSString *user;
} DomainRelationships;
extern const struct DomainRelationships {
__unsafe_unretained NSString *records;
__unsafe_unretained NSString *registrant;
__unsafe_unretained NSString *user;
} DomainRelationships;
@lukeredpath
lukeredpath / gist:10637096
Created April 14, 2014 10:47
git ci -m "Got married"
From 84ce1471f76b84bb5bfa369dab19f4d920096e4f Mon Sep 17 00:00:00 2001
From: Luke Redpath <luke@lukeredpath.co.uk>
Date: Mon, 14 Apr 2014 11:46:21 +0100
Subject: [PATCH] Got married
---
_includes/about.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/_includes/about.html b/_includes/about.html
@lukeredpath
lukeredpath / SwiftExpectations.swift
Last active August 29, 2015 14:02
My first experiments with Swift
// Playground - noun: a place where people can play
import Cocoa
protocol Matcher {
func matches(object: AnyObject) -> Bool
}
class EqualMatcher: Matcher {
let testObject: AnyObject
@lukeredpath
lukeredpath / GenericMatchers.swift
Last active August 29, 2015 14:02
A more generic approach to expectations
import Cocoa
protocol Matcher {
typealias Matchable
func matches(object: Matchable) -> Bool
}
class EqualMatcher<T:Equatable>: Matcher {
typealias Matchable = T
@lukeredpath
lukeredpath / rspec_eventually.rb
Created June 13, 2014 16:14
A small extension to RSpec that uses the Wrong gem
# gem install wrong
require 'wrong'
class RSpec::Expectations::ExpectationTarget
include Wrong::Assert
include Wrong::Eventually
def will(matcher)
eventually { to(matcher) }
end
@lukeredpath
lukeredpath / .travis.yml
Created July 30, 2014 11:40
My Travis CI iOS deployment/build setup
language: objective-c
rvm: 2.1.1
install: bundle
before_script: ./script/add-key.sh
after_script: ./script/remove-key.sh
script: ./script/travis.sh
env:
/Applications/Xcode6-Beta4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
From 1ad1e05f28a81cf7e2f3bc65d43b45b12e075742 Mon Sep 17 00:00:00 2001
From: Luke Redpath <luke@lukeredpath.co.uk>
Date: Thu, 7 Aug 2014 17:09:50 +0100
Subject: [PATCH] Allow protocol mocks to not implicitly handle optional
protocol methods.
---
Source/OCMockito/MKTObjectAndProtocolMock.m | 2 +-
Source/OCMockito/MKTProtocolMock.h | 6 ++++--
Source/OCMockito/MKTProtocolMock.m | 9 +++++----
(lldb) po viewController
error: instance variable '_modalPresentationStyle' declared with incompatible types in different translation units ('UIModalPresentationStyle' vs. 'UIModalPresentationStyle')
error: instance variable '_lastKnownInterfaceOrientation' declared with incompatible types in different translation units ('UIInterfaceOrientation' vs. 'UIInterfaceOrientation')
error: instance variable '_viewControllerFlags' declared with incompatible types in different translation units ('<anonymous struct>' vs. '<anonymous struct>')
error: property 'modalPresentationStyle' declared with incompatible types in different translation units ('UIModalPresentationStyle' vs. 'UIModalPresentationStyle')
error: instance method 'modalPresentationStyle' has incompatible result types in different translation units ('UIModalPresentationStyle' vs. 'UIModalPresentationStyle')
note: declared here with type 'UIModalPresentationStyle'
note: declared here with type 'UIInterfaceOrientation'
note: declared here with type '<anonymou