Skip to content

Instantly share code, notes, and snippets.

@jackbaty
jackbaty / Makefile
Created June 30, 2023 10:35
Makefile for deploying baty.net
View Makefile
SERVER_HOST=servername.baty.net
SERVER_DIR=/home/jbaty/apps/baty.net/public_html
PUBLIC_DIR=/Users/jbaty/sites/blog/public/
TARGET=DigitalOcean
.POSIX:
.PHONY: build checkpoint deploy
# search index. No longer used.
# npx -y pagefind --source public
View my-template.latex
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
\PassOptionsToPackage{hyphens}{url}
$if(colorlinks)$
\PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
$endif$
$if(CJKmainfont)$
\PassOptionsToPackage{space}{xeCJK}
$endif$
%
View config.el
(setq doom-font (font-spec :family "iosevka Comfy" :size 16)
doom-variable-pitch-font (font-spec :family "iA Writer Quattro V" :size 13))
@jackbaty
jackbaty / myessentials.lrtemplate
Last active August 14, 2021 11:53
My Lightroom Metadata field set
View myessentials.lrtemplate
return {
version = 1,
title = 'My Essentials',
id = 'com.mytagsets.tagset2',
type = 'MetadataFieldList',
sortOrder = -9,
items = {
'com.adobe.metadataStatus',
'com.adobe.filename',
'com.adobe.copyname',
@jackbaty
jackbaty / titleUrlMarkdownClip.js
Last active August 7, 2021 10:48 — forked from idelem/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in various formats to clipboard, like [title](url) - (Org mode, TiddlyWiki, and Markdown)
View titleUrlMarkdownClip.js
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;
View gist:f4a7ecff1af638af45abd584dcbeb761
javascript: (function() {
let sel = document.getSelection();
let selText = "";
let reference = `[[${location.href }][${document.title }]]`;
const selectedRanges = [];
if (sel.rangeCount > 1) {
selText = reference + "\n";
for (let i = 0; i < sel.rangeCount; i += 1) {
selText += `\t${sel.getRangeAt(i).toString().trim()}<<< \n`;
selectedRanges.push(sel.getRangeAt(i))
@jackbaty
jackbaty / README.md
Created May 25, 2021 09:05 — forked from mikepqr/README.md
Make printouts from Firefox Reader mode look like dang NYRB artices
View README.md

To install in Firefox:

  1. If it doesn't already exist, create a folder called chrome in your profile folder. The easiest way to find your profile folder is in about:profiles (there's a "Show in Finder" link for the folder on macOS). Be sure to choose the right profile is you have more than one.

  2. Put userContent.css above in the chrome folder you just created.

  3. Load about:config in Firefox then set toolkit.legacyUserProfileCustomizations.stylesheets to true.

  4. Quit and reopen Firefox, just for luck.

@jackbaty
jackbaty / org-quote.txt
Last active May 4, 2020 13:17
Bookmarklet for adding quotes to org-mode
View org-quote.txt
Copied and modified from someone's (Anne-Laure Le Cunff?) Roam bookmarklet
javascript:(function(){let sel=document.getSelection();let selText="";const reference=`[[${location.href}][${document.title}]] `;const%20selectedRanges=[];if(sel.rangeCount>1){selText=reference+"\n";for(let%20i=0;i<sel.rangeCount;i+=1){selText+=`\t/${sel.getRangeAt(i).toString().trim()}/%20\n`;selectedRanges.push(sel.getRangeAt(i))}}else{selText=sel.toString().trim();if(selText.length){selectedRanges.push(sel.getRangeAt(0));selText=`/${%20selText%20}/%20via%20`}selText+=reference}const%20ta=document.createElement("textarea");ta.textContent=`${%20selText%20}`;document.body.appendChild(ta);const%20docSel=document.getSelection();docSel.removeAllRanges();ta.select();document.execCommand("copy");docSel.removeAllRanges();document.body.removeChild(ta);let%20newSel=document.getSelection();for(let%20i=0;i<selectedRanges.length;i+=1){newSel.addRange(selectedRanges[i])}let%20toaster=document.createElement("div");toaster.innerHTML=`Copied!`;toast
View gist:49179309f4ecc861547d97a7dc3f282b
<item>
{{^metadata.micro}}<title><![CDATA[ {{{metadata.icon}}} {{{title}}} ]]></title>{{/metadata.micro}}
<link>{{{blogURL}}}{{url}}</link>
<guid>{{{blogURL}}}{{url}}</guid>
{{! RSS feeds need a RFC 822 date}}
<pubDate>{{#formatDate}}ddd, DD MMM YYYY HH:mm:ss ZZ{{/formatDate}}</pubDate>
<dc:creator><![CDATA[ Jack Baty ]]></dc:creator>
<description><![CDATA[ {{{body}}} ]]></description>
</item>
View org-config.org