Skip to content

Instantly share code, notes, and snippets.

View ashuttl's full-sized avatar

Andrew Shuttleworth ashuttl

View GitHub Profile
Delivered-To: ashuttleworth+fonts@gmail.com
Received: by 2002:a4f:2645:0:0:0:0:0 with SMTP id m66csp480613ivm;
Fri, 25 Jan 2019 05:51:46 -0800 (PST)
X-Received: by 2002:a37:553:: with SMTP id 80mr10062636qkf.200.1548424306220;
Fri, 25 Jan 2019 05:51:46 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1548424306; cv=none;
d=google.com; s=arc-20160816;
b=ctD1wD6QUABBb1WziUmtYK3+Xg5N/24fq8Yn9vhSBA7KhXFU/j5qWPQFrp5e2J/h0n
TQB468WmW9PjpY/z9QgQbRC74Lkb0qAnBQ+5V1Yuw0XP8waEAmHsJ7Om5P+paO8kYiwD
H6h45hkRHJ3ZNW3jRnNHFiU5Vy1KOSUSvxVvX8Lyfn7O6Fkb8kBBKDaOaYYCwFnH7rA8
@ashuttl
ashuttl / TransparentBlue.taskpapertheme
Last active August 29, 2015 14:02
My customized version of the Transparent Blue TaskPaper theme. Original is at https://github.com/dataduke/mac-taskpaper/blob/master/Themes/Transparent%20Blue.taskpapertheme
<theme>
<!-- Window Style -->
<color alpha="1.0" blue="0.99" green="0.80" id="foreground" red="0.59"/>
<color alpha=".95" blue=".1" green=".1" id="background" red=".1"/>
<window backgroundColorID="background" foregroundColorID="foreground" shouldUseHUDScrollers="yes"/>
<!-- Text View Style -->
<color alpha="1.0" blue=".48" green=".48" id="tag" red=".48"/>
<color extendsColorID="foreground" id="handle"/>
@ashuttl
ashuttl / remove-given-tags.applescript
Created May 27, 2014 20:50
Remove given tags from a TaskPaper document
set userCanceled to false
set prompt to "What tags would you like me to remove? Separate multiple tags with a space."
tell application "TaskPaper"
try
set dialogResult to display dialog prompt buttons {"Cancel", "OK"} default button "OK" cancel button "Cancel" default answer "today next" with icon 1
set tagsToRemove to text returned of dialogResult
on error number -128
set userCanceled to true
@ashuttl
ashuttl / inbox.applescript
Created April 24, 2014 22:44
Reminders.app inbox to TaskPaper inbox
tell application "Reminders"
tell account "iCloud"
tell list "Inbox"
set inbox_contents to (get reminders)
if length of inbox_contents is greater than 0 then
repeat with k from 1 to length of inbox_contents
set this_todo to item k of inbox_contents
set inbox_item to "- " & (get name of this_todo)
tell application "TaskPaper"
tell document "Active.txt"
@ashuttl
ashuttl / browsers.md
Created March 6, 2014 13:54
Supported browsers
  • IE/Windows 8/9 (to the extent possible)
  • IE/Windows 10+ (fully)
  • Safari/Mac 6+
  • Chrome/Desktop 32+
  • Chrome/Android 32+
  • Firefox/Desktop 24+
  • Safari/iOS 6+
  • Android browser 4+
-- How many votes did each candidate get?
SELECT count(*) AS "votes", `candidate` FROM 2014_votes
GROUP BY candidate;
-- How many votes did each candidate get from people who gave us an email address?
SELECT count(*) AS "votes", `candidate` FROM 2014_votes
WHERE email != ""
GROUP BY candidate;
-- When did votes come in?
@ashuttl
ashuttl / datalayer-sample.html
Created September 11, 2013 19:30
Data Layer sample for confirmation page
<script>
dataLayer.push({
'event': 'transaction',
'transactionId': '<transaction ID>', // Order number sent as string
'transactionDate': '<transaction date>', // Date of transaction in form 2013-12-31
'transactionAffiliation': 'Lincoln Center', // Always "Lincoln Center"
'transactionTotal': <transactionTotal>, // Total value of transaction sent as floating point number
'transactionShipping': <transactionShipping>, // Shipping cost sent as floating point number. Required; 0.00 if n/a
'transactionTax': <transactionTax>, // Tax charged sent as floating point number. Required; 0.00 if n/a
@ashuttl
ashuttl / lc-gtm.html
Created September 11, 2013 19:12
Lincoln Center Google Tag Manager code
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-7H6Q"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-7H6Q');</script>
<!-- End Google Tag Manager -->
@ashuttl
ashuttl / gist:6365068
Created August 28, 2013 11:33
LC DataLayer Sample
dataLayer.push({
'event': 'transaction', // Always "transaction"
'transactionId': '<order number>',
'transactionDate': '<date in format 2013-08-28>',
'transactionTotal': 200, // Total value of transaction as a number, not a currency-string
// Each item purchased should be represented as a separate object in this array
'transactionProducts': [{
'sku': '<unique ID for performance>', // Does this exist? If not, can we create one out by making a slug of the performance name, date, and time (e.g. 'london-symphony-orchestra-10-27-2013-1030pm')?
'name': '<name of performance>',