Skip to content

Instantly share code, notes, and snippets.

View tkirby's full-sized avatar

Todd Kirby tkirby

  • Bangkok, Thailand
View GitHub Profile
@tkirby
tkirby / MOScrollViewSwift.swift
Created June 23, 2018 11:39
A port of MOScrollView to Swift 4.1
//
// MOScrollViewSwift.swift
//
// Port of MOScrollView (https://github.com/jan-christiansen/MOScrollView)
// to swift by Richard Todd Kirby
//
//
import UIKit
#!/bin/zsh
function actual_path() {
if [ [ -z "$1" ] -a [ -d $1 ] ]; then
echo $(cd $1 && test `pwd` = `pwd -P`)
return 0
else
return 1
fi
}
@tkirby
tkirby / gco.sh
Created November 15, 2012 11:09
Display menu of local git branches and allow to choose which to checkout by number.
#!/bin/bash
branches=()
eval "$(git for-each-ref --shell --format='branches+=(%(refname:short))' refs/heads/)"
# Set the prompt for the select command
PS3="Select a branch. 'q' to quit: "
select branch in "${branches[@]}"
do
@tkirby
tkirby / NSDictionary+QueryStringBuilder.h
Created March 25, 2012 12:48 — forked from neolee/NSDictionary+QueryStringBuilder.h
Creating a query string from an NSDictionary.
#import <Foundation/Foundation.h>
@interface NSDictionary (QueryStringBuilder)
- (NSString *)queryString;
@end