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
@lukeredpath
lukeredpath / Email to TFL re: Bow RLJs
Last active August 29, 2015 14:07
Red light jumping at Bow roundabout - below is TFLs response to my email about trying to make this better and a small selection of examples from YouTube.
My original email:
Hi there,
I'm emailing you to share my experience of cycling over Bow roundabout, particularly with reference to the early start system in place.
http://www.tfl.gov.uk/travel-information/improvements-and-projects/bow-roundabout
The above article claims that the early start system makes the roundabout safer - and I can see the logic behind it - but in reality, the junction is still very dangerous as cyclists are exposed to dangers from traffic already on the roundabout jumping the red lights.
@lukeredpath
lukeredpath / gist:41c3f3c50534602213ad
Created September 30, 2014 15:13
travis-postgres-error
$ sudo service postgresql start 9.3
* Starting PostgreSQL 9.3 database server  * Error: /var/ramfs/postgresql/9.3/main is not accessible or does not exist
Date: 24.09.2014
Dear Mr Redpath
Thank you for contacting us on 10 September 2014 suggesting improvements for Bow roundabout.
I am sorry you have experienced motorist jumping the red lights at Bow roundabout.
(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
From 1ad1e05f28a81cf7e2f3bc65d43b45b12e075742 Mon Sep 17 00:00:00 2001
From: Luke Redpath <[email protected]>
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 +++++----
@lukeredpath
lukeredpath / capture.rb
Created August 5, 2014 15:31
Rspec mock argument capture
# just an example of what it could be
argument = capture('label')
widget = double
# argument acts like an argument matcher that always matches but stores a reference to the real value
allow(widget).to receive(:do_something).with(argument)
# contrived, I know this could be done using the instance_of argument matcher
expect(argument.value).to be_instance_of(Something)
/Applications/Xcode6-Beta4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
@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:
@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 / 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