Skip to content

Instantly share code, notes, and snippets.

View simonwhatley's full-sized avatar

Simon Whatley simonwhatley

View GitHub Profile
@simonwhatley
simonwhatley / gist:5908651
Last active December 19, 2015 05:59
Google Glass UA string
Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; Glass 1 Build/IMM76L; XE7) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
@simonwhatley
simonwhatley / gist:5919917
Created July 3, 2013 16:12
Tony Hoare on software design
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." Tony Hoare

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt

Sketch Plugins

A list of Sketch plugins hosted at GitHub, in no particular order.

// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@simonwhatley
simonwhatley / Vagrantfile
Last active August 29, 2015 14:22 — forked from JeffreyWay/Vagrantfile
Simple Vagrant set-up
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: "192.168.33.21"
@simonwhatley
simonwhatley / install.sh
Last active August 29, 2015 14:22 — forked from JeffreyWay/install.sh
LAMP install script
#!/usr/bin/env bash
# Update the package list
sudo apt-get update
sudo apt-get upgrade -y
# Install more recent PPA (do not do that except you are sure of what you are doing)
sudo apt-get install -y vim curl python-software-properties
@simonwhatley
simonwhatley / VagrantSetup.sh
Created June 8, 2015 13:25
Terminal commands for Vagrant setup
sudo curl -L -o install.sh http://bit.ly/1Fuonbs
sudo curl -L -o Vagrantfile http://bit.ly/1QpJtNa
sudo vagrant up
@simonwhatley
simonwhatley / ListFilenamesInFinder.scpt
Last active August 15, 2016 15:48
AppleScript to list filenames in a chosen folder in Finder
set the_string to ""
tell application "Finder"
repeat with this_item in (get items of (choose folder))
set the_string to the_string & name of this_item & tab & modification date of this_item & tab & size of this_item & tab & kind of this_item & return
end repeat
end tell