Skip to content

Instantly share code, notes, and snippets.

kylefox / color.m
Created Jan 27, 2012
Generate a random color (UIColor) in Objective-C
View color.m
Distributed under The MIT License:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
erikreagan /
Created Aug 4, 2012
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

croxton / gist:4073583
Last active Mar 29, 2021
Install xdebug 2.2.0 for AMPPS on OSX
View gist:4073583
Grab the 'PHP Remote Debugging Client' (the pre-complied xdebug binary for OSX) from here:
Unzip it, find the folder that corresponds to the version of PHP you want to install it for and copy the file from there into your php extensions folder in the relevant PHP version directory. E.g. for PHP 5.4:
Now open PHP.ini in a text editor:
jellybeansoup /
Last active Dec 31, 2018
Install Autoconf and Automake on OS X Mountain Lion
# Install autoconf, automake and libtool smoothly on Mac OS X.
# Newer versions of these libraries are available and may work better on OS X
# This script is originally from
export build=~/devtools # or wherever you'd like to build
willurd /
Last active Jul 25, 2021
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
hujunfeng /
Last active Jun 16, 2021
UDID, identifierForVendor and advertisingIdentifier FAQ

What's the difference between UUID, GUID and UDID?

  • UUID (Universally Unique Identifier): A sequence of 128 bits that can guarantee uniqueness across space and time, defined by [RFC 4122][rfc4122].

  • GUID (Globally Unique Identifier): Microsoft's implementation of the UUID specification; often used interchangeably with UUID.

  • UDID _(Unique Device Identifier)): A sequence of 40 hexadecimal characters that uniquely identify an iOS device (the device's Social Security Number, if you will). This value can be retrieved through iTunes, or found using UIDevice -uniqueIdentifier. Derived from hardware details like MAC address.

Is UDID deprecated?


Creating a dynamic site-to-site VPN with OpenSwan on Ubuntu 10.04 on EC2

Wes Winham

There are many tutorials floating around the web that almost get you a dynamic VPN in EC2. The goal of this tutorial is to be a one-stop-shop for this specific setup.

stigi / CocoaLumberjack.swift
Created Aug 16, 2014
A little hack to work comfortably with cocoa lumberjack in Swift.
View CocoaLumberjack.swift
// Created by Ullrich Schäfer on 16/08/14.
// Bitmasks are a bit tricky in swift
// See
//enum LogFlag: Int32 {
// case Error = 0b1
// case Warn = 0b10
// case Info = 0b100
depl0y / CocoaLumberjack.swift
Last active Aug 29, 2015
CocoaLumberjack Swift Wrapper, fixed for Xcode 6 B6 and up
View CocoaLumberjack.swift
// Created by Ullrich Schäfer on 16/08/14.
// Bitmasks are a bit tricky in swift
// See
//enum LogFlag: Int32 {
// case Error = 0b1
// case Warn = 0b10
// case Info = 0b100
oleganza /
Last active Apr 3, 2021
Concrete proposal for async semantics in Swift

Async semantics proposal for Swift

Modern Cocoa development involves a lot of asynchronous programming using blocks and NSOperations. A lot of APIs are exposing blocks and they are more natural to write a lot of logic, so we'll only focus on block-based APIs.

Block-based APIs are hard to use when number of operations grows and dependencies between them become more complicated. In this paper I introduce asynchronous semantics and Promise type to Swift language (borrowing ideas from design of throw-try-catch and optionals). Functions can opt-in to become async, programmer can compose complex logic involving asynchronous operations while compiler produces necessary closures to implement that logic. This proposal does not propose new runtime model, nor "actors" or "coroutines".

Table of contents