Skip to content

Instantly share code, notes, and snippets.

View adamteale's full-sized avatar

Adam Teale adamteale

  • Apply Digital
  • Santiago, Chile
View GitHub Profile
@aerickson
aerickson / rsync_with_progress.py
Created October 13, 2011 05:09
Get total rsync progress using Python
# from https://libbits.wordpress.com/2011/04/09/get-total-rsync-progress-using-python/
import subprocess
import re
import sys
print('Dry run:')
cmd = 'rsync -az --stats --dry-run ' + sys.argv[1] + ' ' + sys.argv[2]
proc = subprocess.Popen(cmd,
shell=True,
@zenorocha
zenorocha / README.md
Last active April 6, 2024 16:59
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@bmatcuk
bmatcuk / symbolizing_osx_crash_logs.md
Created May 29, 2014 21:43
How to symbolize OSX crash logs

How to Symbolize OSX Crash Logs

Unfortunately, xcode does not yet have support for importing OSX crash logs and symbolizing them. Therefore, you must use the command line and a little bit of manual work.

  1. Find your dSYM file.
    1. Assuming you are using xcode's archive functionality, open the Organizer window from the Window menu.
    2. Click the Archives tab.
    3. Right click on the appropriate build and select Show in Finder.
    4. When Finder opens, right click on the selected archive and select Show Package Contents.
    5. Navigate to the dSYM directory and copy the appropriate dSYM file to a temporary directory.
  2. Then navigate to Products, then Applications, and copy the app file to the same temporary directory.
@isoiphone
isoiphone / UIImage+color.swift
Created March 28, 2016 16:45
Create UIImage of solid color
extension UIImage {
class func imageWithColor(color: UIColor, size: CGSize=CGSize(width: 1, height: 1)) -> UIImage {
UIGraphicsBeginImageContextWithOptions(size, false, 0)
color.setFill()
UIRectFill(CGRect(origin: CGPoint.zero, size: size))
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image
}
}
@wata
wata / ISOString.swift
Last active March 28, 2023 14:46
A simple ISO string parsing and converting library for Swift
public struct ISOString {
/// Parse ISO 6709 string.
/// e.g. "+34.0595-118.4460+091.541/"
/// SeeAlso: [ISO 6709](https://en.wikipedia.org/wiki/ISO_6709)
public static func parse(iso6709 text: String?) -> CLLocation? {
guard
let results = text?.capture(pattern: "([+-][0-9.]+)([+-][0-9.]+)"),
let latitude = results[safe: 1] as NSString?,
let longitude = results[safe: 2] as NSString?
else { return nil }