Skip to content

Instantly share code, notes, and snippets.

// Playground - noun: a place where people can play
import UIKit
/*
Variables
*/
//
//var x : Int = 1
@archgrove
archgrove / resizeIcons.sh
Created January 15, 2014 14:47
# resizeIcons.sh # Creates new sizes from a source PNG in the iOS icon sizes
#!/bin/sh
# resizeIcons.sh
# Creates new sizes from a source PNG in the iOS icon sizes
# adamw@archgrove.co.uk
# Depends: sips (OS X scriptable image processing)
function resize {
currentImage=$1
newImage=$2
@archgrove
archgrove / gist:6814567
Created October 3, 2013 18:24
Export all canvases of an Omnigraffle Professional document using osascript from the command line
on replace_string(input, search, replacement)
set oldDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to search
set textItems to every text item of input
set AppleScript's text item delimiters to replacement
set res to textItems as string
set AppleScript's text item delimiters to oldDelim
return res
end replace_string
@archgrove
archgrove / gist:6766129
Created September 30, 2013 16:09
Replays a git history, passing the repository at each state to a given script
#!/bin/bash
# Takes a repository and script from the command line
# and executes the script for each git log entry in reverse chronological order
# Use temporary files of the following format
TMP_TEMPLATE="/tmp/gitreplay-XXXXXXXX"
# Validate command line parameters
if [ -z $1 -o -z $2 ]; then
@archgrove
archgrove / ResetOldUnplayed
Created April 21, 2013 18:00
A small Applescript to reset the unplayed status of TV shows not watched in the last 3(ish) months. Makes the AppleTV display them with the shiny blue dot!
tell application "iTunes"
set d to (current date) - (12 * weeks)
repeat with t in (every track where played date is less than d and video kind is TV show)
set unplayed of t to true
end repeat
end tell
@archgrove
archgrove / OGExportAllForLaTeX.scpt
Created May 10, 2012 15:09
Omnigraffle "Export all Canvases for LaTeX"
# Replace "search" with "replacement" in "input" (all text)
on replace_string(input, search, replacement)
set oldDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to search
set textItems to every text item of input
set AppleScript's text item delimiters to replacement
set res to textItems as string
set AppleScript's text item delimiters to oldDelim
return res