Skip to content

Instantly share code, notes, and snippets.


Daniel Beard daniel-beard

View GitHub Profile
stevenp / gist:a6740694b4e23baccfab
Last active Sep 10, 2015
Disable App Transport Security in iOS 9
View gist:a6740694b4e23baccfab
Add this to the Info.plist:
jpr5 / bot.rb
Created Apr 26, 2011
XMPP/Ruby Bot for HipChat
View bot.rb
#!/usr/bin/env ruby
# Script: HipChat bot in Ruby
# Author: Jordan Ritter <>
unless `rvm-prompt i g`.chomp == "ree@xmpp"
exec("rvm ree@xmpp ruby #{$0}")
View how to resolve compiler

Xcode loads xcspec files (ascii plists) that specify everything (tools, buildphases, compilers, rules, etc) based on a set of conditions.

To evaluate these conditions you have to load these files and simulate the build process and construct your own "environment"

The target's build settings will help to resolve most of the environment variables by taking the basics from the particular platform you are using for the target (resolved from the SDKROOT value xcrun --show-sdk-platform-path --sdk)

when you load the spec of the compiler there is a key on it called "Options" which is an array of dictionaries that have

lucholaf / gist:e37f4d26e406250a156a
Last active Sep 5, 2016
Xcode pre-action: generate Swift FAT file to reduce compilation time, since it's faster to recompile the whole source code in a single file
View gist:e37f4d26e406250a156a
> $PROJECT_DIR/merge.swift; find $PROJECT_DIR/ -iname *.swift -not -name merge.swift -exec cat {} >> $PROJECT_DIR/merge.swift \;
samstokes / todo
Last active Nov 2, 2018
A todo management system in a gist
View todo
#!/bin/bash -e
if [[ $# > 0 ]]; then
case "$1" in
-h | -\? | --help )
echo "Add a todo:"
echo " todo Reformulate the widget plans."
echo "See what you have to do:"
echo " todo"
View random.swift
import Darwin
extension Int {
static func random() -> Int {
return Int(arc4random())
static func random(range: Range<Int>) -> Int {
return Int(arc4random_uniform(UInt32(range.endIndex - range.startIndex))) + range.startIndex
nicklockwood / gist:9605636
Last active Dec 11, 2019
Singleton Category implementation
View gist:9605636
@protocol Singleton
+ (instancetype)sharedInstance;
View Regex.swift
struct Regex {
let pattern: String
let options: NSRegularExpressionOptions!
private var matcher: NSRegularExpression {
return NSRegularExpression(pattern: self.pattern, options: self.options, error: nil)
init(pattern: String, options: NSRegularExpressionOptions = nil) {
self.pattern = pattern
dnozay /
Last active Aug 5, 2020
jenkins groovy scripts collection.
ddunbar /
Last active Aug 24, 2020
Xcode new build system debugging tricks

New Build System Tricks

Command Line

alias xcbuild=$(xcode-select -p)/../SharedFrameworks/XCBuild.framework/Versions/A/Support/xcbuild
# THIS DOESNT WORK YET: xcbuild openIDEConsole  # … then switch to Xcode ➡️
xcbuild showSpecs
xcbuild build <foo.pif> [—target <target>]
You can’t perform that action at this time.