Skip to content

Instantly share code, notes, and snippets.

@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-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 & "
Debugger entered--Lisp error: (void-variable G43505)
ad-Advice-magit-status(#[(dir) "\304!\211\204\305\306\307\"!\203\310!\210\304! \205>\311 !\210\312\313 \"\2062\314\315\316\317 !!\320Q!\321\n \"\210\322 \313\323#))\207" [dir topdir buf magit-status-buffer-switch-function magit-get-top-dir y-or-n-p format "There is no Git repository in %S. Create one? " magit-init magit-save-some-buffers magit-find-buffer magit-status-mode generate-new-buffer "*magit: " file-name-nondirectory directory-file-name "*" magit-mode-display-buffer magit-mode-init magit-refresh-status] 6 ("/Users/bradleyw/.emacs.d/.elpa/24.3.50.1/magit-20131126.621/magit.elc" . 192294) (list (if current-prefix-arg (magit-read-top-dir (> (prefix-numeric-value current-prefix-arg) 4)) (or (magit-get-top-dir) (magit-read-top-dir nil))))] "/Users/bradleyw/Projects/emacs.d/")
apply(ad-Advice-magit-status #[(dir) "\304!\211\204\305\306\307\"!\203\310!\210\304! \205>\311 !\210\312\313 \"\2062\314\315\316\317 !!\320Q!\321\n \
Vagrantfile:
Vagrant::Config.run do |config|
config.vm.define :web do |web_config|
web_config.vm.provision :puppet, :options => "--verbose --debug" do |web_puppet|
web_puppet.module_path = "puppet/modules"
web_puppet.manifests_path = "puppet/manifests"
web_puppet.manifest_file = "web.pp"
end
@bradwright
bradwright / .zshrc
Created September 14, 2012 15:16
Git completion
# -*- mode: sh -*-
autoload -Uz compinit
compinit
source_if_exists() {
[ -f $1 ] && source $1
}
# These are installed by homebrew
@bradwright
bradwright / mkflask.sh
Created May 13, 2012 19:41 — forked from urschrei/mkflask.sh
Bootstrap a Flask project
#!/bin/bash -e
# opinionated Flask bootstrap script
# assumes you'll be using MySQL, Fabric, and Blueprints
# creates a virtualenv and an Alembic migrations system
# The script will halt on any error, and remove the project dir if it created one
# accepts a single argument: a new directory name under which to create the project
# check that Python is installed
type python >/dev/null 2>&1 || { echo >&2 "Python doesn't appear to be installed. Aborting."; exit 1; }
@bradwright
bradwright / gist:2490524
Created April 25, 2012 15:15 — forked from czottmann/gist:2490462
The Unfollow Manifesto

The Unfollow Manifesto

At some point in the past, I've decided to follow you on Twitter or any other social network, because you appeared to be a person whose postings I might be interested in.

But recently you noticed me unfollowing you.

Now you're confused/sad/angry. Don't be. Because here are the three simple rules I adhere to.

  1. You may unfollow me at any given time, because what I post might not be your cup of tea. It's okay, no hard feelings. I won't take that as an insult. (Really.) I assume we're still cool outside said service, unless of course I wrote some horrible shit that offended you, in which case I am probably sorry.
@bradwright
bradwright / bash_emacs.sh
Created April 25, 2012 12:13
Emacs path mangling on OS X
emacsen=`find ~/Applications/ -name Emacs | head -n 1`
if [ -n "$emacsen" ]; then
alias emacs="$emacsen"
emacsclient=`find ~/Applications -name emacsclient | head -n 1`
alias emacsclient="'$emacsclient'"
alias vemacs="'$emacsclient' -c -n"
export EDITOR="'$emacsclient' -t"
export VISUAL="'$emacsclient' -c"
fi
@bradwright
bradwright / init.pp
Created April 1, 2012 12:26
Install PIL with Puppet on Ubuntu 11.10
# installs PIL. PIL is rubbish to install because of broken
# dependencies on libjpeg etc, so we need to do some symlinking
class pil {
# libpng is already installed, and I don't care about libfreetype etc.
package { [ 'libjpeg-dev', 'zlib1g' ]:
ensure => 'installed'
}
file { '/usr/lib/libjpeg.so':
@bradwright
bradwright / path.el
Created March 15, 2012 20:13
Set Emacs exec-path by shell $PATH
;; This sets the Emacs "PATH" environment variable and the `exec-path`
;; variable to the same value your login shell sees. The reason this
;; is necessary is because of this:
;;
;; http://developer.apple.com/library/mac/#qa/qa1067/_index.html
;;
;; Basically apps launched from Finder inherit their environment from
;; a .plist file rather than the shell environment.
(defun set-exec-path-from-shell-PATH ()