Skip to content

Instantly share code, notes, and snippets.

View peterwooley's full-sized avatar

Peter Wooley peterwooley

View GitHub Profile
@peterwooley
peterwooley / translate.applescript
Created November 2, 2016 17:37
Run this AppleScript in an Automator service to open selected text in Google Translate.
-- Modified from http://scriptingosx.com/2016/01/build-a-google-translate-service/
on run {input, parameters}
set theText to input as string
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {return & linefeed, return, linefeed, "
", character id 8233, character id 8232}
-- list of line break chars from http://stackoverflow.com/questions/12546253/how-to-replace-n-in-applescript#12546965
set splitText to text items of theText
set AppleScript's text item delimiters to {space}
set theText to splitText as text
function main() {
if (app.documents.length) {
var outputDir = Folder.selectDialog('Select output folder.', '~');
if (outputDir) {
for (var i = 0; i < app.documents.length; i++) {
doc = app.documents[i];

Keybase proof

I hereby claim:

  • I am peterwooley on github.
  • I am peterwooley (https://keybase.io/peterwooley) on keybase.
  • I have a public key whose fingerprint is C4AB 79F6 EC45 689B 13F1 B335 47A1 7F4E 409B 1956

To claim this, I am signing this object:

@peterwooley
peterwooley / triademail.txt
Last active December 12, 2015 08:18
Tri-Ad email with backslahes where forward slashes should be.
Delivered-To: [email protected]
Received: by 10.64.126.201 with SMTP id na9csp32238ieb;
Thu, 17 Jan 2013 09:43:20 -0800 (PST)
X-Received: by 10.68.234.167 with SMTP id uf7mr15749962pbc.20.1358444599558;
Thu, 17 Jan 2013 09:43:19 -0800 (PST)
Return-Path: <[email protected]>
Received: from barracuda.tri-ad.com (mail.tri-ad.com. [207.7.103.198])
by mx.google.com with ESMTPS id w3si2423844pbz.78.2013.01.17.09.43.19
(version=TLSv1 cipher=RC4-SHA bits=128/128);
Thu, 17 Jan 2013 09:43:19 -0800 (PST)
@peterwooley
peterwooley / cygup
Created August 12, 2012 07:46
Run the latest Cygwin setup.exe to install or upgrade Cygwin
# Run the latest Cygwin setup.exe to install or upgrade Cygwin
# Make sure to run `Set-ExecutionPolicy RemoteSigned` in PowerShell
# prior to the execution of this script.
$file = "$env:temp\setup.exe"
(new-object System.Net.WebClient).DownloadFile("http://cygwin.com/setup.exe", $file)
& $file
# ~/.gitconfig from @boblet
# initially based on http://rails.wincent.com/wiki/Git_quickstart
[color]
ui = auto
interactive = auto
[repack]
usedeltabaseoffset = true # >git 1.5
[alias]
s = status
@peterwooley
peterwooley / dabblet.css
Created June 4, 2012 06:19
Gradient-y button
/**
* Gradient-y button
*/
body { background:#444; }
button {
background: #686d76 linear-gradient(90deg, rgba(0,0,0,.26), rgba(255,255,255,.26));
border:none;
border-radius:5px;
padding:10px 0;
@peterwooley
peterwooley / week9links.txt
Created May 31, 2012 04:18
Links from WDIM262 Week 9
/**
* Curtains
*/
.screen, .curtains {
background:#ccc;
width:400px;
height:300px;
}
.curtains {
background:none;