Skip to content

Instantly share code, notes, and snippets.

@bradwright
bradwright / Instructions.md
Created October 24, 2015 21:11
Copy all files from one place to another, recursively, sleeping between runs
  1. Download the above file and save it somewhere (eg ~/Downloads)
  2. Open Terminal.app, and go to where it's saved (eg cd ~/Downloads)
  3. Run the script, with the HDD volume as the first argument, eg: python sleep-and-copy.py /Volumes/Thing/Path/to/itunes /Library/Local-path-to-itunes

Keybase proof

I hereby claim:

  • I am bradwright on github.
  • I am bradwright (https://keybase.io/bradwright) on keybase.
  • I have a public key whose fingerprint is 79EE 15F3 67EA 61C6 4F98 69AE C101 6131 8826 6237

To claim this, I am signing this object:

@bradwright
bradwright / clear-available-flags.scpt
Last active August 29, 2015 14:10
Clear the flagged state of all available tasks
-- Unflag every available task in every context (it has to be assigned a context)
tell application "OmniFocus"
tell default document
set flagged of (every available task of every flattened context whose flagged is true) to false
end tell
end tell
@bradwright
bradwright / README.md
Last active August 29, 2015 14:07
Send current Evernote link to clipboard

Add this script in Automator as a service for "Evernote".

@bradwright
bradwright / content-api.json
Last active August 29, 2015 14:06
Example output from GOV.UK APIs
{
"id":"https://www.gov.uk/api/bank-holidays.json",
"web_url":"https://www.gov.uk/bank-holidays",
"title":"UK bank holidays",
"format":"custom-application",
"updated_at":"2014-06-27T13:14:21+01:00",
"tags":[
{
"id":"https://www.gov.uk/api/tags/section/working%2Ftime-off.json",
"slug":"working/time-off",
@bradwright
bradwright / versioning-api.md
Created May 13, 2014 10:06
GOV.UK versioning API

Summary

An append-only datastore with API to store all published versions of a document.

User needs

  • As a citizen, I need to see change history of a document so I can see how a policy or official document evolves over time (TRUST)
  • As someone whose job relies on historical versions (e.g a tax accountant, lawyer), I need to be able to see older versions of documents from specific points in time, so I can refer to them

Technical sketch

@bradwright
bradwright / private.xml
Last active August 29, 2015 14:00
KeyRemap4MacBook XML configuration for the Tarmak transitional layout
<?xml version="1.0"?>
<root>
<item>
<name>Tarmak transitional layout</name>
<!-- http://forum.colemak.com/viewtopic.php?pid=8786#p8786 -->
<item>
<name>Tarmak1(E) transitional layout (E&gt;K&gt;N&gt;J)</name>
<identifier>private.tarmak.tarmak_1_e</identifier>
<autogen>__KeyToKey__ KeyCode::K, KeyCode::E</autogen>
<autogen>__KeyToKey__ KeyCode::N, KeyCode::K</autogen>
@bradwright
bradwright / send-mail-to-omnifocus-and-archive.scpt
Last active August 25, 2016 19:05
Take current Mail.app message, send its subject and 'message:<>' URL to OmniFocus, and then Archive the email
-- Send currently selected Mail.app message to OmniFocus 2 quick entry box, then archive it
-- Archive behaviour found at: http://vemedio.com/blog/posts/my-archive-email-apple-script
tell application "Mail"
set theSelectedMessages to selection
set the selected_message to item 1 ¬
of the theSelectedMessages
set message_id to the message id of the selected_message
set my_subject to the subject of the selected_message
set message_url to "message://%3c" & message_id & "%3e"

Keybase proof

I hereby claim:

  • I am bradleywright on github.
  • I am bradwright (https://keybase.io/bradwright) on keybase.
  • I have a public key whose fingerprint is 79EE 15F3 67EA 61C6 4F98 69AE C101 6131 8826 6237

To claim this, I am signing this object:

@bradwright
bradwright / send-chrome-tab-to-omnifocus.scpt
Created February 19, 2014 22:07
Send current Chrome tab to OmniFocus
on run {input, parameters}
tell application "Google Chrome"
set theName to title of active tab of front window
set theUrl to URL of active tab of front window
tell application "OmniFocus"
set theTask to theName
set theNote to theUrl
tell quick entry
set NewTask to make new inbox task with properties {name:theTask, note:theNote}