Skip to content

Instantly share code, notes, and snippets.

Derick Fay derickfay

Block or report user

Report or block derickfay

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@derickfay
derickfay / exportMarkdown.md
Created Jul 12, 2019
BibDesk Markdown export template
View exportMarkdown.md

<$publications> <$pubType=book?> <$pubAuthors.abbreviatedNormalizedName.stringByRemovingTeX.@componentsJoinedByCommaAndAnd/> <$pubFields.Year/>. <$pubFields.Title/>. <$pubFields.Address/>: <$pubFields.Publisher/>.

<$pubAuthors.abbreviatedNormalizedName.stringByRemovingTeX.@componentsJoinedByCommaAndAnd/> <$pubFields.Year/>. <$pubFields.Title/>. In <$pubFields.Booktitle/>. <$pubEditors.abbreviatedNormalizedName.stringByRemovingTeX.@componentsJoinedByCommaAndAnd/>, eds. <$pubFields.Pages?>Pp. <$pubFields.Pages/></$pubFields.Pages?>. <$pubFields.Address/>: <$pubFields.Publisher/>.

@derickfay
derickfay / sk2c single note templated.applescript
Created Mar 9, 2019
Export selected Skim notes to the clipboard using native Skim templates
View sk2c single note templated.applescript
(* 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)
@derickfay
derickfay / Dates.js
Last active Mar 2, 2019
Date text formatter for Copied
View Dates.js
// 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 / export skim notes to markdown on clipboard sorting by color.applescript
Last active Jun 21, 2019
export skim notes to markdown on clipboard sorting by color.applescript
View 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 / btt-skim.json
Last active Feb 11, 2019
Skim Touch Bar preset
View btt-skim.json
[
{
"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 / bttGlobal.json
Created Jul 17, 2018
Global toggle button for BTT
View bttGlobal.json
{
"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 / clean.js
Created May 11, 2018
Clean scraped results from the National Archives of South Africa
View clean.js
// 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," ");
View Broke.js
// 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 / lookup_publishers.applescript
Created Apr 12, 2017
BibDesk AppleScript to look up missing publisher locations
View lookup_publishers.applescript
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 / night.less
Last active Oct 23, 2018
nighttime TaskPaper 3 theme
View night.less
// 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;
You can’t perform that action at this time.