Skip to content

Instantly share code, notes, and snippets.

View derickfay's full-sized avatar

Derick Fay derickfay

View GitHub Profile
@derickfay
derickfay / day.less
Last active October 23, 2018 21:41
daytime TaskPaper 3 theme
// UI Scale
@base-font-size: 16;
@user-font-size: $USER_FONT_SIZE;
@ui-scale: @user-font-size / @base-font-size;
// UI Colors
@tint-color: darkblue;
@handle-color: white;
@collapsed-color: red;
@derickfay
derickfay / night.less
Last active November 18, 2021 15:58
nighttime TaskPaper 3 theme
// UI Scale
@base-font-size: 16;
@user-font-size: $USER_FONT_SIZE;
@ui-scale: @user-font-size / @base-font-size;
// UI Colors
@tint-color: rgb(173,216,230);
@handle-color: black;
@collapsed-color: red;
@derickfay
derickfay / lookup_publishers.applescript
Created April 12, 2017 17:37
BibDesk AppleScript to look up missing publisher locations
tell application "BibDesk"
activate
-- without document, there is no selection, so nothing to do
if (count of documents) = 0 then
beep
display dialog "No documents found." buttons {"•"} default button 1 giving up after 3
end if
set thePublications to the selection of document 1
@derickfay
derickfay / Broke.js
Created April 23, 2018 21:18
Broken prompt
// See online documentation for examples
// http://getdrafts.com/scripting
var p = Prompt.create();
p.title = "";
p.message = "";
p.addButton("Add to draft");
p.addTextField("Enter text", "t","");
var con = p.show();
@derickfay
derickfay / clean.js
Created May 11, 2018 16:58
Clean scraped results from the National Archives of South Africa
// scraper for http://www.national.archsrch.gov.za/sm300cv/smws/sm300dl
//
// usage: select results in search results, enter multiple documents view, then copy contents of the results frame to a text file called archives.txt
const fieldnames = ["Document","DEPOT","SOURCE","TYPE","VOLUME_NO","SYSTEM","REFERENCE","PART","DESCRIPTION","STARTING","ENDING","REMARKS.*"]
const replacements = ["",",",",",",",",",",",",",",",",",",",",",""]
var fs = require('fs');
var path = process.cwd();
let d = fs.readFileSync(path + "/archives.txt").toString().replace(/\,/g," ");
@derickfay
derickfay / bttGlobal.json
Created July 17, 2018 10:23
Global toggle button for BTT
{
"BTTTouchBarButtonName" : "Global",
"BTTTriggerType" : 629,
"BTTTriggerClass" : "BTTTriggerTypeTouchBar",
"BTTPredefinedActionType" : 190,
"BTTPredefinedActionName" : "Force Show\/Hide Global BTT Touch Bar Actions",
"BTTEnabled2" : 1,
"BTTUUID" : "937923F9-24F3-4AD7-883F-7DE9E2D3FA30",
"BTTEnabled" : 1,
"BTTOrder" : 5,
@derickfay
derickfay / btt-skim.json
Last active October 1, 2020 19:49
Skim Touch Bar preset
[
{
"BTTTouchBarButtonName" : "P",
"BTTTriggerType" : 629,
"BTTTriggerClass" : "BTTTriggerTypeTouchBar",
"BTTPredefinedActionType" : 172,
"BTTPredefinedActionName" : "Run Apple Script (blocking)",
"BTTInlineAppleScript" : "tell application \"BetterTouchTool\"\r\t(* light purple *)\r\tupdate_trigger \"625CCE43-9BF7-403E-8AEF-331CA96BBD0E\" json \"{\\\"BTTTriggerConfig\\\":{\\\"BTTTouchBarButtonColor\\\" : \\\"204,102,255,100\\\"}}\"\r\t(* dim yellow *)\r\tupdate_trigger \"701399EC-B8BF-472D-8A2E-4F9FB5F01F75\" json \"{\\\"BTTTriggerConfig\\\":{\\\"BTTTouchBarButtonColor\\\" : \\\"0,0,0,20\\\"}}\"\r\t(* dim green *)\r\tupdate_trigger \"E395E5B6-E655-47EA-BDD1-F6BE0086BE3B\" json \"{\\\"BTTTriggerConfig\\\":{\\\"BTTTouchBarButtonColor\\\" : \\\"0,0,0,20\\\"}}\"\r\t(* dim text selection *)\r\tupdate_trigger \"E5BDF354-1D20-414A-A7B8-A2861F299A3B\" json \"{\\\"BTTTriggerConfig\\\":{\\\"BTTTouchBarButtonColor\\\" : \\\"0,0,0,20\\\"}}\"\r\t(* dim underline *)\r\tupdate_trigger \"EC62F039-63
@derickfay
derickfay / export skim notes to markdown on clipboard sorting by color.applescript
Last active June 21, 2019 17:19
export skim notes to markdown on clipboard sorting by color.applescript
(* EXPORT ALL SKIM NOTES TO THE CLIPBOARD
(no longer) requires hackademic URL handler from github user smargh
entirely rewritten to take advantage of Skim's built-in templating
2016-06-26 by derickfay
2019-02-09 updated to group notes by color
*)
property LF : (ASCII character 10)
@derickfay
derickfay / Dates.js
Last active March 2, 2019 04:50
Date text formatter for Copied
// there are two parts to this text formatter. Both draw heavily from
// the date calculation snippets created by Brett Terpstra - see
// https://brettterpstra.com/2015/06/01/textexpander-5-javascript-snippets/
// part 1 - the date library
// strftime for JS <http://hacks.bluesmoon.info/strftime/>
Date.prototype.locale = 'en-GB';
Date.ext = {};
Date.ext.util = {};
@derickfay
derickfay / sk2c single note templated.applescript
Created March 9, 2019 23:49
Export selected Skim notes to the clipboard using native Skim templates
(* EXPORT SELECTED NOTES TO THE CLIPBOARD
(no longer) requires hackademic URL handler from github user smargh
entirely rewritten to take advantage of Skim's built-in templating
2019-03-10 by derickfay
*)
property LF : (ASCII character 10)