Skip to content

Instantly share code, notes, and snippets.

View danielctull's full-sized avatar

Daniel Tull danielctull

View GitHub Profile
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names
@bewebste
bewebste / machine.h.motemplate
Created June 4, 2011 19:14
MOGenerator diff template
{
name = <$name$>,
managedObjectClassName = <$managedObjectClassName$>,
renamingIdentifier = <$renamingIdentifier$>,
isAbstract = <$isAbstract$>,
userInfo = <$userInfo$>,
relationships = (
<$foreach Relationship noninheritedRelationships do$>
{
name = <$Relationship.name$>,
#import <Cocoa/Cocoa.h>
BOOL VerifyAppStoreReceipt();
BOOL VerifyAppStoreReceiptData(NSData *data);
NSURL *BackupReceiptURL();
void BackupAppStoreReceipt();
NSData *MACAddressData();
NSDictionary *DictionaryFromAppStoreReceipt(NSData *fullData);
@mikehaertl
mikehaertl / gist:3258427
Created August 4, 2012 15:40
Learn you a Haskell - In a nutshell

Learn you a Haskell - In a nutshell

This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.


1. Introduction

  • Haskell is a functional programming language.
@danielctull
danielctull / GlobalSettings.plist
Created August 7, 2012 14:48 — forked from samdeane/GlobalSettings.plist
Script for generating appledoc docs
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>--project-company</key>
<string>Elegant Chaos</string>
<key>--company-id</key>
<string>com.elegantchaos</string>
<key>--keep-undocumented-objects</key>
<false/>
@danielctull
danielctull / ActivityController.h
Created December 13, 2012 13:56
A controller object that presents an activity view controller either modally or in a popover depending on the platform. It associates the created controller object with the activity view controller or popover controller, so that when either are dismissed, all the associations are removed. This way if you hold only a *weak* reference to the retur…
#import <UIKit/UIKit.h>
@interface ActivityController : NSObject
+ (instancetype)presentActivityItems:(NSArray *)activityItems
fromViewController:(UIViewController *)viewController
barButtonItem:(UIBarButtonItem *)item;
@end
NSManagedObjectContext *contextOne = ...;
NSArray *objects = ...<result of fetch request on contextOne...
NSManagedObjectID *objectID = objects[0].objectID;
NSManagedObjectContext *contextTwo = ...;
id object = [contextTwo existingObjectWithID:objectID error:nil]; // returns the right object
NSAssert(![object.objectID isTemporaryID]); // passes
id otherObject = [contextTwo objectWithID:objectID]; // always returns an object, should be the right object
NSAssert(![otherObject.objectID isTemporaryID]); // fails!
@andrewsardone
andrewsardone / gist:6458455
Created September 6, 2013 01:32
script/sort-xcodeproj for handy Xcode project organization
#!/bin/bash
#
# Usage: script/sort-xcodeproj to sort all root-level Xcode projects.
# This helps keep the Xcode project layout neat and consistent while
# aiding in the prevention of [merge conflicts][mc].
#
# [mc]: http://danieltull.co.uk/blog/2013/09/05/easier-merging-of-xcode-project-files/
SCRIPT_DIR=$(dirname "$0")
cd "$SCRIPT_DIR/.."
@andymatuschak
andymatuschak / CollectionViewDataSource.swift
Last active February 12, 2021 09:44
Type-safe value-oriented collection view data source
//
// CollectionViewDataSource.swift
// Khan Academy
//
// Created by Andy Matuschak on 10/14/14.
// Copyright (c) 2014 Khan Academy. All rights reserved.
//
import UIKit
@steipete
steipete / gist:99f8aa8d6527fa027fd6
Last active August 29, 2015 14:25
Mirror for https://forums.developer.apple.com/thread/11098 since that needs moderation first (submitted Jul 16 2015)
We're working on supporting Bitcode in PSPDFKit but hit a blocking issue with OpenSSL (latest 1.0.2d).
We're using a script that downloads and builds OpenSSL into fat static libraries for both Mac and iOS. I've put the gist here:
https://gist.github.com/steipete/ce09ba176a4b8ef66b2d/bf053eab1c0f8494dcd3748079543c4ed4367b9c
Enabling Bitcode should be as easy as adding `-fembed-bitcode` as clang flag according to this entry. That's exactly what I did.
Now things build, but the script eventually stops with this error:
ld: could not open bitcode temp file: ../libcrypto.a(aes-x86_64.o) for architecture x86_64