Skip to content

Instantly share code, notes, and snippets.

View JimRoepcke's full-sized avatar

Jim Roepcke JimRoepcke

View GitHub Profile
@BanzaiMan
BanzaiMan / README.md
Last active August 29, 2015 14:00
XCode code signing issue with OS X Mavericks images

Issue

Users report issues with code signing their Objective-C based project with the newly-rolled out Mavericks image on Travis CI.

The error looks something like:

Code Sign error: No codesigning identities found: No codesigning identities (i.e. certificate and private key pairs) that match the provisioning profile specified in your build settings ("Chappy Dev Adhoc") were found. CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.1'

Workaround

A couple of users have reported that setting the keychain in use to be the default will fix this issue. For example:

@MaximKeegan
MaximKeegan / xcode_ramdisk.sh
Created April 12, 2012 03:28
Create a RAM disk for using with XCode
#!/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"
@landonf
landonf / 1-README.md
Last active June 2, 2016 06:49
Swift Result Type

A result type (based on swiftz) that can represent either an error or success:

enum Result<X, T> {
  case Err(() -> X)
  case Ok(() -> T)
}

Now we need a way to chain multiple results together without lots of nesting of if statements -- or exceptions. To do so, we can define a new bind (result, next) operator (implementation borrowed from swiftz) that operates on Result types (a.k.a flatMap or >>=):

  • If the result is Err, the result is immediately returned.
@guillermo
guillermo / my_app.sh
Created January 15, 2014 08:27
This is a unix wrapper around the erlang vm.
#!/bin/bash
# This is a unix wrapper around the erlang vm. It provides the following functionality:
#
# * Spawns in foreground
# * Handle SIGHUP and call RELOADFUNC
# * Handle SIGTERM SIGQUIT and SIGINT telling to the vm to quit
# * Dies if the vm dies (for example kernel killing because out of memory)
#
# Forks and improvements are welcome.
@andymatuschak
andymatuschak / MultiDirectionAdjudicatingScrollView.swift
Created January 26, 2015 19:31
Source for the Khan Academy app's unusual scrolling interactions
//
// MultiDirectionAdjudicatingScrollView.swift
// Khan Academy
//
// Created by Andy Matuschak on 12/16/14.
// Copyright (c) 2014 Khan Academy. All rights reserved.
//
import UIKit
import UIKit.UIGestureRecognizerSubclass
@danielctull
danielctull / UnwrapView.swift
Last active November 5, 2019 00:43
A view which takes a value and shows one view or another depending on whether the value is nil or not.
import SwiftUI
public struct UnwrapView<Some: View, None: View>: View {
private let some: () -> Some?
private let none: () -> None?
public init<Value>(value: Value?,
some: @escaping (Value) -> Some,
@prendio2
prendio2 / SUPTableViewController.m
Created March 26, 2014 15:05
Custom viewWillApear to restore selected row when transition is cancelled
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
NSIndexPath *selectedRowIndexPath = [self.tableView indexPathForSelectedRow];
if (selectedRowIndexPath) {
[self.tableView deselectRowAtIndexPath:selectedRowIndexPath animated:YES];
[[self transitionCoordinator] notifyWhenInteractionEndsUsingBlock:^(id<UIViewControllerTransitionCoordinatorContext> context) {
if ([context isCancelled]) {
[self.tableView selectRowAtIndexPath:selectedRowIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
@marcpalmer
marcpalmer / ExtendedScrollView.swift
Created March 5, 2020 21:20
Work in progress UIScrollView-alike in SwiftUI
//
// ContentView.swift
// ExtendedScrolView
//
// Created by Marc Palmer on 05/03/2020.
// Copyright © 2020 Montana Floss Co. Ltd. All rights reserved.
//
import SwiftUI
@rdougan
rdougan / CollectionViewListLayout.swift
Created September 29, 2015 10:42
A basic NSCollectionViewLayout subclass which displays NSCollectionView items in a list layout.
//
// CollectionViewListLayout.swift
// money
//
// Created by Robert Dougan on 29/09/15.
// Copyright © 2015 Phyn3t. All rights reserved.
//
import Cocoa
@karwa
karwa / codablebridge.swift
Created November 1, 2017 04:57
codable-nscoding bridge
import Foundation
/// This isn't safe to use before Swift gets ABI stability, because generic classes
/// could change their names. Also, be sure to register bridges with the Obj-C runtime
/// if using to decode during iOS state restoration.
///
class CodableBridge<Wrapped: Codable>: NSObject, NSSecureCoding {
let value: Wrapped
init(_ value: Wrapped) { self.value = value }