Skip to content

Instantly share code, notes, and snippets.

View paulz's full-sized avatar
🍐
pairing is caring

Paul Zabelin paulz

🍐
pairing is caring
View GitHub Profile
@farshadtx
farshadtx / movie.md
Last active August 3, 2022 19:37 — forked from jeisenberg/movie.md

Movie Ticket Kata

What Are We Building?

Write a program that calculates purchase price for movie tickets using swift. It should not be a full-blown mobile app; it can be a simple class or collection of methods invokable by your test suite. We'll provide you with some requirements, test-cases, and even a sample interface - all you have to do is give us some software.

Base Admission Rate

The Base Admission Rate cover movies to be viewed on a regular weekday (see "Special Movie Day" below), in 2D, with a length of <= 120 minutes, viewed from the main seating area (there is also a balcony seating area, which is much fancier).

@grigorye
grigorye / Podfile
Last active January 10, 2022 12:37
Disable coverage for cocoapods (incl. Swift)
# Append the block below to your Podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |configuration|
configuration.build_settings['CLANG_ENABLE_CODE_COVERAGE'] = 'NO'
configuration.build_settings['SWIFT_EXEC'] = '$(SRCROOT)/SWIFT_EXEC-no-coverage'
end
end
end
@jedi4ever
jedi4ever / gist:7677d62f1414c28a1a8c
Last active November 20, 2020 07:28
Some notes on travisci remote debugging via ssh or screenshot or remote desktop of Mac VM builds
Some notes on remote debugging mac builds on Travisci. It's hard to tell when something hangs what the cause it. Trial and error via commits is tedious. And on Mac , sometimes it's the gui asking for input. So I worked my around to get the access I needed for faster debugging a build.
#################################################
# Enable remote ssh access to travisci build for debugging
#################################################
# Add a key so we can login to travisci vm
- cat ssh/travisci.pub >> ~/.ssh/authorized_keys
- chmod 600 ssh/travisci
# Install netcat
@Odie
Odie / gist:e26bc299bfc1f020e636
Created October 9, 2014 12:10
Parse user friendly time duration string in Swift
import UIKit
extension NSDateComponents {
subscript(unit: String) -> Int {
get {
switch unit{
case "month":
return self.month
case "day":
return self.day
@steipete
steipete / PSPDFUIKitMainThreadGuard.m
Last active May 27, 2024 12:11
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework http://pspdfkit.com, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>
@blazingpair
blazingpair / latest_kiwi_with_hamcrest.podspec
Last active December 11, 2015 03:58
Kiwi integrated with OCHamcrest
Pod::Spec.new do |s|
s.name = 'Kiwi'
s.version = '2.0.3.dev'
s.summary = 'A Behavior Driven Development library for iOS and OS X.'
s.homepage = 'https://github.com/allending/Kiwi'
s.authors = { 'Allen Ding' => 'alding@gmail.com', 'Luke Redpath' => 'luke@lukeredpath.co.uk' }
s.license = { :type => 'MIT', :file => 'License.txt' }
s.source = { :git => 'https://github.com/allending/Kiwi.git', :commit => 'b5b4223884a60fa9842986421ace13ec576b54e1'}
s.source_files = FileList['Classes/*.{h,m}'].exclude(/KWStringPrefixMatcher/).exclude(/KWStringContainsMatcher/)
s.framework = 'SenTestingKit'
@peterc
peterc / dnsd.rb
Created December 2, 2011 23:47
Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL