Skip to content

Instantly share code, notes, and snippets.

View warrenburton's full-sized avatar

Warren Burton warrenburton

View GitHub Profile
@warrenburton
warrenburton / spliticon.pl
Last active August 29, 2015 14:13
Down samples a base png at 3x to 2x and 1x and outputs 3 UIKit style named files usage: spliticon.pl masterfile.png
#! /usr/bin/perl
#usage spliticon.pl masterfile.png
#e.g masterfile.png at 90*60
#outputs 3 files into subdir spliticons of cwd
#spliticons/masterfile.png at 30*20
#spliticons/masterfile@2x.png at 60*40
#spliticons/masterfile@3x.png at 90*60
use File::Basename;
@warrenburton
warrenburton / imageset-repair
Last active August 29, 2015 14:04
A command line tool for repairing Xcode xcasset sets which have gained a bunch of "unassigned image" warnings. Strips any dictionaries which have no "filename" reference from the images dictionary. Point it at the .imageset folder you wish to repair.
//
// main.m
// imageset-repair
//
// Created by Warren Burton on 25/07/2014.
// Create a new Xcode commmand line project and paste into main.m
// Use with a source control system
// May have unintended consequnces so you will want the ability to revert.
//
@warrenburton
warrenburton / enumify.pl
Created March 14, 2014 10:34
converts a typical C style enum declaration into a corresponding switch/case block
#! /usr/bin/perl
#enumify.pl
#converts a typical enum declaration into a corresponding switch/case block
#e.g.
# typedef enum {
# Foo,
# Bar,
# Baz
@warrenburton
warrenburton / generate_icons.sh
Last active December 23, 2015 13:56
Batch script for creating iOS icon sizes
#!/bin/bash
#Usage:
#generate_icons.sh /path/to/mastericon.png
#Assumes your master icon image is larger than 180px by 180px at least
i=0
sizes=(76 72 50 40 29 57 60 167)