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 / 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) {
#!/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 September 17, 2012 22:07 — 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
#!/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"