Skip to content

Instantly share code, notes, and snippets.

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

Klaas Pieter Annema klaaspieter

🏠
Working from home
View GitHub Profile
@klaaspieter
klaaspieter / Pizza.swift
Created February 2, 2015 20:55
An implementation of the Builder pattern in Swift
import Foundation
enum Cheese : String {
case Mozzarella = "Mozzarella"
case Provolone = "Provolone"
case Pecorino = "Pecorino"
}
class PizzaBuilder {
var size: Int = 0
@klaaspieter
klaaspieter / p12 -> pem
Last active May 20, 2016 05:41
Convert from p12 to pem and copy contents
openssl pkcs12 -in Certificates.p12 -nodes -clcerts | pbcopy
@klaaspieter
klaaspieter / gist:8440369
Created January 15, 2014 17:19
Triggering actions on controls using sendActionsForControlEvents: will not pass a `UIEvent` to action:forEvent:
@implementation ViewController
- (void)triggerAction;
{
[self.button sendActionsForControlEvents:UIControlEventTouchUpInside];
}
- (void)action:(id)sender forEvent:(UIEvent *)event;
{
// event is UIEvent when triggered by a touch on the button.
@klaaspieter
klaaspieter / gist:6977907
Created October 14, 2013 15:57
UIBarItem appearance proxy not working
[[UIBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Light" size:12.0],
NSForegroundColorAttributeName: [UIColor blueColor]} forState:UIControlStateNormal];
NSLog(@"attributes: %@", [[UIBarItem appearance] titleTextAttributesForState:UIControlStateNormal]); // (null)
@klaaspieter
klaaspieter / GoogleAnalytics-iOS-SDK.podspec
Last active December 24, 2015 02:59
Google Analytics 3.0.1 SDK with TagManager
Pod::Spec.new do |s|
s.name = "GoogleAnalytics-iOS-SDK"
s.version = "3.0.1"
s.summary = "GoogleAnalytics for iOS SDK."
s.description = <<-DESC
The Google Analytics SDK for iOS makes it easy for native iOS developers to collect user engagement data form their applications. Developers can then use the Google Analytics reports to measure:
* The number of active users are using their applications.
* From where in the world the application is being used.
* Adoption and usage of specific features.
Pod::Spec.new do |s|
s.name = "ObjectiveMixin"
s.version = "1.0.1"
s.summary = "Ruby-like mixin functionality for Objective-C programs."
s.homepage = "https://github.com/vl4dimir/ObjectiveMixin"
s.license = { :type => 'BSD', :file => 'LICENSE' }
s.author = "Vladimir Mitrovic"
s.source = { :git => "https://github.com/vl4dimir/ObjectiveMixin.git", :tag => "1.0.1" }
Pod::Spec.new do |s|
s.name = 'CountryPicker'
s.version = '1.0.1'
s.license = { :file => 'LICENCE.md' }
s.homepage = 'https://github.com/nicklockwood/CountryPicker'
s.authors = { 'Nick Lockwood' => 'support@charcoaldesign.co.uk' }
s.summary = 'CountryPicker is a custom UIPickerView subclass that provides an iOS control allowing a user to select a country from a list..'
s.source = { :git => 'https://github.com/nicklockwood/CountryPicker.git', :tag => '1.0.1' }
s.source_files = 'CountryPicker/*.{h,m}'
s.resources = ['CountryPicker/Countries.plist', 'Flags/*.png']
Pod::Spec.new do |s|
s.name = "FontReplacer"
s.version = "1.0"
s.summary = "Easily create nibs with custom fonts."
s.homepage = "https://github.com/0xced/FontReplacer"
s.license = ''
s.author = { "Cédric Luthi" => "cedric.luthi@gmail.com" }
s.source = { :git => "https://github.com/0xced/FontReplacer.git", :tag => "1.0" }
s.platform = :ios, '3.2'
s.source_files = 'UIFont+Replacement/UIFont+Replacement.{h,m}'
@klaaspieter
klaaspieter / Podfile
Created March 27, 2013 19:31
Example of a Podfile that uses my fixed stripe-ios branch but still fails Note: requires Cocoapods 0.17.0.rc5
platform :ios, '6'
pod 'Stripe', :git => 'https://github.com/klaaspieter/stripe-ios.git', :branch => 'missing-header'
@klaaspieter
klaaspieter / Podfile
Last active December 15, 2015 11:59
Example podfile for including Stripe that is currently not working
platform :ios, '6'
pod 'Stripe', :git => 'https://github.com/stripe/stripe-ios.git'