Skip to content

Instantly share code, notes, and snippets.

@sirtimbly
sirtimbly / gist:4608284
Created January 23, 2013 15:38
Customized the default Hit List Apple Mail script to work better for my needs. Truncating email subject to 24 characters and the sender to the first two words. Due date is now 2 days from today not from the date it was sent.
(*
The Hit List Mail Import (customized for shorter and concise subjects by TB)
Copyright © 2012 Potion Factory LLC.
Licensed under a Creative Commons Attribution 3.0 License: http://creativecommons.org/licenses/by/3.0/
To customize this script, copy it first to:
#!/usr/bin/python
import sys
import os, shutil
import subprocess
import os.path
from datetime import datetime
######################## Functions #########################
@sirtimbly
sirtimbly / gist:748351ed29c19d4cbf43
Created September 8, 2014 19:28
mail to evernote
-- Slightly modified version of Efficient Computing's AppleScript: http://efficientcomputing.commons.gc.cuny.edu/2012/03/17/copy-email-message-in-mail-app-to-evernote-applescript/
tell application "Mail"
--get selected messages
set theSelection to selection
--loop through all selected messages
repeat with theMessage in theSelection
--get information from message
set theMessageDate to the date received of theMessage
@sirtimbly
sirtimbly / gist:57bb6fce2a861628e007
Created September 8, 2014 19:32
mail to taskpaper text file
-- Quite a lot modified to input text into a plain text file like used by taskpaper. Originally based somewhere back in time on Efficient Computing's AppleScript: http://efficientcomputing.commons.gc.cuny.edu/2012/03/17/copy-email-message-in-mail-app-to-evernote-applescript/
tell application "Mail"
--get selected messages
set theSelection to selection
--loop through all selected messages
repeat with theMessage in theSelection
--get information from message
set theMessageDate to the date received of theMessage
@sirtimbly
sirtimbly / keybase.md
Created January 12, 2015 22:04
keybase.md

Keybase proof

I hereby claim:

  • I am sirtimbly on github.
  • I am sirtimbly (https://keybase.io/sirtimbly) on keybase.
  • I have a public key whose fingerprint is BB9A 8F08 A763 D832 2CD6 FFB2 6CF3 B94C B486 41B1

To claim this, I am signing this object:

@sirtimbly
sirtimbly / gist:988d4c1e26e8c5666ac2
Created April 1, 2015 14:31
pattern-lab performance script
<script type="text/javascript">
$('iframe#sg-viewport').load(function() {
var now = new Date().getTime();
var perfTimes = this.contentWindow.performance.timing;
var page_load_time = now - perfTimes.navigationStart;
var response_start_time = perfTimes.responseStart - perfTimes.navigationStart;
var response_end_time = perfTimes.responseEnd - perfTimes.navigationStart;
var response_dom_int = perfTimes.domInteractive - perfTimes.navigationStart;
console.log("User-perceived page loading time: " + page_load_time);
$('#sg-perf-toggle').html(page_load_time + 'ms');
@sirtimbly
sirtimbly / patternlab-performance.html
Created April 1, 2015 14:32
pattern-lab performance display menu
<li class="sg-perf">
<a href="#" class="sg-acc-handle sg-perf-toggle" id="sg-perf-toggle" title="perf">00</a>
<ul class="sg-acc-panel sg-right">
<li class="stat responseStart" title="ms until server response started">responseStart: <span id="sg-response-start"></span></li>
<li class="stat responseEnd" title="ms until server response finished">responseEnd: <span id="sg-response-end"></span></li>
<li class="stat domInteractive" title="ms until dom was interactive to user">domInteractive: <span id="sg-dom-interactive"></span></li>
<li class="stat domInteractive" title="ms until dom was completely loaded">domLoaded: <span id="sg-dom-loaded"></span></li>
</ul>
</li>
@sirtimbly
sirtimbly / handbrake hazel bash script.txt
Created April 27, 2015 03:27
Hazel Handbrake conversion bash script
outdir=${$1%/*}
filename=${s##*/}
filename=${filename%.*}
output_filename="$outdir/$filename.m4v"
HandBrakeCLI -i $1 -o $output_filename --preset="Normal"
@sirtimbly
sirtimbly / cause of death.md
Last active May 10, 2016 16:44
accidental causes of death

Cause of Death from 1999 - 2014

Injury Intent: Unintentional Injury Mechanism & All Other Leading Causes: Natural/Environmental

Cause Deaths
Total 25946
Exposure to excessive natural cold 10599
@sirtimbly
sirtimbly / airmail-to-textfile.scpt
Created November 1, 2016 02:14
Plain Text Productivity - Airmail email client messages become new tasks in a text file
-- Create a new task based on the currently selected message in Airmail
-- When Script is run (I suggest FastScripts https://red-sweater.com/fastscripts/) A new line will be added to the taskpaper file of your choice.
-- Quite a lot modified to input text into a plain text file like used by taskpaper. Originally based somewhere back in time on Efficient Computing's AppleScript: http://efficientcomputing.commons.gc.cuny.edu/2012/03/17/copy-email-message-in-mail-app-to-evernote-applescript/
set theTaskFile to "/Users/tbendt/Dropbox/_Tim/Projects/_tasks/projects.taskpaper"
tell application "Airmail 2"
--get selected messages
set theSelection to selected messages
--loop through all selected messages