Skip to content

Instantly share code, notes, and snippets.

@bradwright
bradwright / send-to-omnifocus.scpt
Last active August 29, 2015 13:56
Send current MailPlane email to OmniFocus (with Mailplane and Gmail links as notes)
on run {input, parameters}
tell application "Mailplane 3"
set theEmailUrl to currentURL
set theGmailUrl to my replace_chars(theEmailUrl, "mailplane://bradley.wright%40digital.cabinet-office.gov.uk/", "https://mail.google.com/mail/ca/u/0/")
set theSubject to currentTitle
tell application "OmniFocus"
set theTask to theSubject
set theNote to theEmailUrl & "
@bradwright
bradwright / send-safari-to-omnifocus.scpt
Created February 19, 2014 22:02
Send current Safari tab to OmniFocus
on run {input, parameters}
tell application "Safari"
set theUrl to (URL of current tab of window 1)
set theName to (name of current tab of window 1)
tell application "OmniFocus"
set theTask to theName
set theNote to theUrl
@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}

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 / 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 / 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 / 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 / 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 / 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
# Useful snippet if you have a list of files with spaces in their names
# (I'm looking at you, OS X)
# path separators so I can use spaces in filenames
OLD_IFS=${IFS}
# just use a linebreak and remove the space character
IFS="
"
select opt in $list_of_files_with_spaces ; do
echo $opt