Skip to content

Instantly share code, notes, and snippets.

View derickfay's full-sized avatar

Derick Fay derickfay

View GitHub Profile
@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 / 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 / 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;
(* EXPORT ALL SKIM NOTES TO THE CLIPBOARD WITH MARKDOWN REFERENCE LINKS
(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
*)
@derickfay
derickfay / jstorPDFtoBibTeX.sh
Last active June 2, 2016 04:54
Extract bibliographic information in BibTeX format from PDF from jstor.org
#!/bin/sh
# jstorPDFtoBibTeX
# requires pdftotext, tag
# has about a 85% success rate in my experience
header="@article{"
footer="}\n\n"
biblio=""
for filename in "$@"
@derickfay
derickfay / lstag.sh
Last active April 29, 2018 23:10
Search for files with a given tag in the current working directory only
if [ "$#" -ne 1 ]
then
echo "Usage: lstag <tag>"
exit 1
fi
mdfind "kMDItemUserTags == '*$1*'" -onlyin . | sort --ignore-case | grep $PWD | grep -v ^$PWD/.*/.*$ | sed 's!.*/!!'
set theDate to do shell script "date '+%Y-%m-%d'"
set outputPath to "~/Dropbox/mytemp/"
set format to "txt"
set counter to 1
set theFolder to "Notes"
-- uses a counter to avoid duplicate filenames if notes have the same title
tell application "Notes"
tell folder theFolder
set theNotes to every note
# !/bin/sh
#
# adds @XXX Taskpaper style tags to a single file as Finder tags,
# converting hyphens to spaces in the process
#
# requires https://github.com/jdberry/tag
#
TAGS=$(grep "@[a-zA-Z\-]*" --only-matching "$1" | sort | uniq | sed 's/@//g;s/-/ /g' | tr '\n' ', ')
tag -a "$TAGS" "$1"
@derickfay
derickfay / TE recipient
Last active December 9, 2017 06:39
TextExpander snippet to add recipient's name to email
-- TextExpander snippet to add recipient's name to email
-- based on http://macsparky.com/blog/2015/6/automatically-add-recipients-name-to-email-with-textexapnder [sic]
-- updated to handle hyphenated first names properly
-- ( Original version would return Young for Young-Hee . This version returns Young-Hee. )
set theResult to ""
tell application "System Events"
tell process "Mail"
tell text field "To:" of window 1
@derickfay
derickfay / fix_notes.applescript
Created April 16, 2015 16:55
Change Keynote Presenter Notes Font and Size for All Slides
tell application "Keynote"
tell document 1
set theSlides to slides
repeat with s in the slides
tell presenter notes of s
set font to "Helvetica"
set size to 24
end tell
end repeat
end tell