Skip to content

Instantly share code, notes, and snippets.

View richardhenry's full-sized avatar

Richard Henry richardhenry

  • San Francisco, CA
View GitHub Profile
@yinsee
yinsee / UIImage+Trim
Last active June 19, 2023 05:33
Trim whitespaces on UIImage
/*
http://stackoverflow.com/questions/9061800/how-do-i-autocrop-a-uiimage/40780523#40780523
*/
import UIKit
extension UIImage {
func trim() -> UIImage {
let newRect = self.cropRect
@rob-murray
rob-murray / upload_testflight.sh
Last active June 4, 2019 05:07
Script to upload .ipa file to Testflight
#!/bin/bash
#
# Simple script to upload .ipa to testflight
# Usage: upload_testflight.sh /path/to/file.ipa /path/to/app.dSYM {build version}
#
# src: https://gist.github.com/rob-murray/7941761
#
if [ $# -lt 3 ]
@jpwatts
jpwatts / xcode-git-version.sh
Created May 11, 2011 16:42
This Xcode 4 build phase script automatically sets the version and short version string of an application bundle based on information from the containing Git repository.
#!/bin/bash
# This script automatically sets the version and short version string of
# an Xcode project from the Git repository containing the project.
#
# To use this script in Xcode 4, add the contents to a "Run Script" build
# phase for your application target.
set -o errexit
set -o nounset