Skip to content

Instantly share code, notes, and snippets.

View tomaskraina's full-sized avatar

Tom Kraina tomaskraina

View GitHub Profile
@tomaskraina
tomaskraina / gist:c489a549ddeccb410401c3c67fd76174
Last active May 5, 2021 07:21 — forked from steipete/ios-xcode-device-support.sh
Using iOS 14 devices with Xcode 11.5 (instead of Xcode 12)
// The trick is to link the DeviceSupport folder from the beta to the stable version.
// sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
// Support iOS 14.5 devices (Xcode 12.5) with Xcode 12.4:
sudo ln -s /Applications/Xcode-12.5.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/14.5 /Applications/Xcode-12.4.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
// Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
@tomaskraina
tomaskraina / CollectionSeparatorView.swift
Last active July 20, 2021 14:04
Show Separators in Collection View Between Cells - make spaces between cells have different color than the background
//
// CollectionSeparatorView.swift
// tomkraina.com
//
// Created by Tom Kraina on 25.7.2017.
// Copyright © 2017 Tom Kraina. All rights reserved.
//
import UIKit
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 May 20, 2020 09:56 — forked from natecook1000/NSCalendar+Swift.swift
Swift-friendly NSCalendar methods
// 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) {
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 September 23, 2018 02:11
NSUserActivity+CustomReflectable extension so an user activity can be po-ed in lldb / Xcode
//
// 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
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 August 22, 2016 09:06
extension NSURLRequest: DebugPrintable
//
// 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 February 4, 2015 15:30
Upload dSYM to Crashlytics Xcode Build Phase
if [ "${CRASHLYTICS_UPLOAD_DSYM}" == "YES" ]; then
echo "Uploading dSYM to Crashlytics..."
chmod 755 ./lib/Crashlytics.framework/run
./lib/Crashlytics.framework/run <secret> <secret>
fi
#!/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"