Skip to content

Instantly share code, notes, and snippets.

View simonwhitaker's full-sized avatar

Simon Whitaker simonwhitaker

View GitHub Profile
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 26, 2024 05:42 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@mmmulani
mmmulani / extract.sh
Created December 14, 2014 16:09
Generates a class-dump for all of Xcode along with C symbols
#!/bin/bash
# Run this with:
# find /Applications/Xcode.app/ -type f -perm -100 -exec ./extract.sh '{}' \;
# Afterwords run: (to remove all empty directories)
# find . -d -type d -empty -exec rmdir {} \;
APP=$1
BASE_DIR=`pwd`
@Inferis
Inferis / ViewController.swift
Last active December 1, 2019 23:27
Beginnings of a GCD wrapper in swift
import UIKit
import QuartzCore
class ViewController: UIViewController {
@IBOutlet weak var label: UILabel
@IBOutlet weak var counter: UILabel
override func viewDidLoad() {
super.viewDidLoad()
@twobitlabs
twobitlabs / gist:4226365
Created December 6, 2012 17:35
Blocks cheat sheet
// http://cocoawithlove.com/2009/10/ugly-side-of-blocks-explicit.html has a nice breakdown of the syntax--it helps to think of the ^ as similar to a pointer dereference symbol *
// block typedef:
typedef void(^Block)();
typedef void(^ConditionalBlock)(BOOL);
typedef NSString*(^BlockThatReturnsString)();
typedef NSString*(^ConditionalBlockThatReturnsString)(BOOL);
// block property with typedef:
@tartley
tartley / exitval in ps1
Created July 10, 2012 14:22
prepend a red 'last command exit value' to PS1, only for non-zero values.
# display red exit value if it isn't zero
PROMPT_COMMAND='EXITVAL=$?; '$PROMPT_COMMAND
GET_EXITVAL='$(if [[ $EXITVAL != 0 ]]; then echo -n "\[\e[37;41;01m\] $EXITVAL \[\e[0m\] "; fi)'
export PS1="$GET_EXITVAL$PS1"
@simonwhitaker
simonwhitaker / UIColor+GSAdditions.h
Created September 15, 2011 11:19
A category on UIColor adding +(UIColor*)colorWithHexValue:(NSString*)hexValue;
//
//
// UIColor+GSAdditions.h
//
// Created by Simon Whitaker at Goo Software Ltd on 15/09/2011.
//
#import <UIKit/UIKit.h>
@interface UIColor (GSAdditions)
#!/usr/bin/env ruby
# Command line util for acquiring a one-off Twitter OAuth access token
# Based on http://blog.beefyapps.com/2010/01/simple-ruby-oauth-with-twitter/
require 'rubygems'
require 'oauth'
puts <<EOS
Set up your application at https://twitter.com/apps/ (as a 'Client' app),