Skip to content

Instantly share code, notes, and snippets.

Tom Kraina tomaskraina

Block or report user

Report or block tomaskraina

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tomaskraina
tomaskraina / CollectionSeparatorView.swift
Last active Aug 2, 2017
Show Separators in Collection View Between Cells - make spaces between cells have different color than the background
View CollectionSeparatorView.swift
//
// CollectionSeparatorView.swift
// tomkraina.com
//
// Created by Tom Kraina on 25.7.2017.
// Copyright © 2017 Tom Kraina. All rights reserved.
//
import UIKit
View KingfisherDownloadDelegate.swift
import Kingfisher
import Alamofire
private var kingfisherDownloadDelegate = KingfisherDownloadDelegate()
class KingfisherDownloadDelegate: ImageDownloaderDelegate {
private var ongoingRequests: [URL] = []
private let lock = NSLock()
@tomaskraina
tomaskraina / NSCalendar+Swift.swift
Last active Feb 27, 2017 — forked from natecook1000/NSCalendar+Swift.swift
Swift-friendly NSCalendar methods
View NSCalendar+Swift.swift
// NSCalendar+Swift.swift
// A set of Swift-idiomatic methods for NSCalendar
// Updated for Swift 3.1
//
// (c) 2015 Nate Cook, licensed under the MIT license
// (c) 2017 Tom Kraina, licensed under the MIT license
public extension Calendar {
/// Returns the hour, minute, second, and nanoseconds of a given date.
func getTimeFromDate(_ date: Date) -> (hour: Int, minute: Int, second: Int, nanosecond: Int) {
View buildsettings.txt
Build settings for action build and target MyApp:
ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = tomkraina
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = NO
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
@tomaskraina
tomaskraina / NSUserActivity+CustomReflectable.swift
Last active Sep 23, 2018
NSUserActivity+CustomReflectable extension so an user activity can be po-ed in lldb / Xcode
View NSUserActivity+CustomReflectable.swift
//
// NSUserActivity+CustomReflectable.swift
// Tom Kraina <me@tomkraina.com>
//
// Created by Tom Kraina on 19/11/2016.
// Copyright © 2016 Tom Kraina <me@tomkraina.com>. All rights reserved.
//
import Foundation
View PayMillSDK.podspec
Pod::Spec.new do |s|
s.name = 'PayMillSDK'
s.version = '2.2.0'
s.summary = "PAYMILL iOS SDK enables processing of payments for iOS applications. Visit http://www.paymill.com for more information."
s.homepage = "https://www.paymill.com/en-gb/documentation-3/reference/mobile-sdk/"
s.license = 'Commercial, :file => License.md'
s.author = { "Paymill GmbH" => "support@paymill.de" }
s.source = { :git => "https://github.com/paymill/paymill-ios.git", :tag => '2.2.0' }
s.ios.deployment_target = '6.0'
s.osx.deployment_target = '10.8'
@tomaskraina
tomaskraina / NSURLRequestExtension.swift
Last active Aug 22, 2016
extension NSURLRequest: DebugPrintable
View NSURLRequestExtension.swift
//
// NSURLRequestExtension.swift
//
// Source: https://gist.github.com/tomaskraina/d644af49e4968de85e34
//
// Created by Tom Kraina on 21/04/2015.
// Copyright (c) 2015 Tom Kraina. All rights reserved.
//
import Foundation
@tomaskraina
tomaskraina / gist:303bd0ad0433bdbf4ec7
Created Feb 4, 2015
Upload dSYM to Crashlytics Xcode Build Phase
View gist:303bd0ad0433bdbf4ec7
if [ "${CRASHLYTICS_UPLOAD_DSYM}" == "YES" ]; then
echo "Uploading dSYM to Crashlytics..."
chmod 755 ./lib/Crashlytics.framework/run
./lib/Crashlytics.framework/run <secret> <secret>
fi
View xcode_ramdisk.sh
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
SYS_CACHES_DIR="/Library/Caches"
@tomaskraina
tomaskraina / Xcode4TestFlightintegration.sh
Created Sep 17, 2012 — forked from incanus/Xcode4TestFlightintegration.sh
Xcode 4 scheme Archive step Post-script for automatic TestFlight build uploading. See the blog post here: http://developmentseed.org/blog/2011/sep/02/automating-development-uploads-testflight-xcode
View Xcode4TestFlightintegration.sh
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
API_TOKEN=<TestFlight API token here>
TEAM_TOKEN=<TestFlight team token here>
SIGNING_IDENTITY="iPhone Distribution: Development Seed"
PROVISIONING_PROFILE="${HOME}/Library/MobileDevice/Provisioning Profiles/MapBox Ad Hoc.mobileprovision"
#LOG="/tmp/testflight.log"
You can’t perform that action at this time.