2022
Exported Video on Macs do not include any EXIF data. Here's how to fix that.
Using Cloudflare Workers to hack around getJson
Proxy to fetch any header or hero image from a URL.
2021
The MiniFlux Blogroll in Hugo on this site is dynamic, pulling in my RSS feeds from Miniflux. I use this partial below to render a list of public feeds by category. It’s important to change $allowed_categories here in the script, and to set miniflux.url and miniflux.apiKey in your site config. {{/* GetMinifluxFeeds Get a list of MiniFlux feeds by category @author @qcasey @context Page (.) @access public @example - Go Template {{ partialCached "func/GetMinifluxFeeds" . }} */}} {{ $mf_url := .Site.Params.miniflux.url }} {{ $mf_apiKey := .Site.Params.miniflux.apiKey }} {{ $allowed_categories := (slice "Digital Gardens and Blogs" "News" "Releases") }} {{ if (and $mf_url $mf_apiKey) }} {{ $categories := getJSON (printf "%s/v1/categories" $mf_url) (dict "X-Auth-Token" $mf_apiKey) }} {{ with $categories }} {{ $feeds := getJSON (printf "%s/v1/feeds" $mf_url) (dict "X-Auth-Token" $mf_apiKey) }} {{ if $feeds }} {{ range $categories }} {{ if in $allowed_categories .title }} {{ $c := . }} <h2 id="{{ $c.title | lower }}">{{ $c.title }}</h2> <ul class="blogroll"> {{ range $feeds }} {{ if eq .category.id $c.id }} <li> <a href="{{ .site_url }}"> {{ with .icon.feed_id }} {{ $icon := getJSON (printf "%s/v1/feeds/%.0f/icon" $mf_url .) (dict "X-Auth-Token" $mf_apiKey) }} {{ with $icon }} <img width="20" height="20" src="data:{{ .data }}" /> {{ end }} {{ end }} {{ .title }} </a> </li> {{ end }} {{ end }} </ul> {{ end }} {{ end }} {{ end }} {{ end }} {{ end }}
The static site generator Hugo doesn’t yet support Wikilinks. This is being considered on this github issue, but in the meantime we need to parse each page’s content to replace wikilinks with a relref internal page link. I use the following code snippet to support wikilinks in Hugo. It can be invoked when you’d normally use {{ .Content }} by calling this instead: {{- partial "content-with-wikilinks" . -}}. {{/* Prints page content with two types of wikilinks rendered (with and without text). Based loosely on https://github.com/milafrerichs/hugo-wikilinks with these improvements: - Renders shortcodes correctly - Handles Links with text - Uses safeHTML instead of markdownify (renders <code></code> blocks correctly) This is redundant once a solution is developed for https://github.com/gohugoio/hugo/issues/3606 @author @qcasey @context Type Page (.) @access public */}} {{ $wikiregexWithText := "\\[\\[([^\\]\\|\\r\\n]+?)\\|([^\\]\\|\\r\\n]+?)\\]\\]" }} {{ $wikiregex := "\\[\\[([^\\]\\|\\r\\n]+?)\\]\\]" }} {{ $page := .Page }} {{ $pageContent := .Content }} {{ range ($wikilinks := .Content | findRE $wikiregex) }} {{ $link := . | replaceRE $wikiregex "$1" }} {{ $wikilink := printf "\\[\\[%s\\]\\]" $link }} {{ with relref $page $link }} {{ $link := printf "%s%s%s%s%s" "<a href=\"" . "\">" ($.Site.GetPage $link).Title "</a>" }} {{ $pageContent = $pageContent | replaceRE $wikilink $link }} {{ end }} {{ end }} {{ range ($pageContent | findRE $wikiregexWithText) }} {{ $link := . | replaceRE $wikiregexWithText "$1" }} {{ $text := . | replaceRE $wikiregexWithText "$2" }} {{ $wikilink := printf "\\[\\[%s\\|%s\\]\\]" $link $text }} {{ with relref $page $link }} {{ $link := printf "%s%s%s%s%s" "<a href=\"" . "\">" $text "</a>" }} {{ $pageContent = $pageContent | replaceRE $wikilink $link }} {{ end }} {{ end }} {{ $pageContent | safeHTML }}
Thanks to /u/orcusvoyager1hampig for spelling this out to me on reddit I go out to dinner with a friend and they offer to pay me back later for their meal. I write this in my ledger: 2021-07-19 * "Chipotle" "Dinner w/Dave" Liabilities:AmEx:Blue -30 USD Assets:Debts:Dave 15 USD Expenses:Dining 15 USD This makes sense to me. Today, I sold something for Dave on ebay. I’m going to reduce what he owes me using that part of the payment: 2021-07-30 * "ebay" "payment" Assets:Bank 25 USD Income:Ebay -20 USD ; my stuff Income:Ebay -5 USD ; Dave's $5 item Assets:Debts:Dave -5 USD ; ???? This does not balance. As a quick fix, I can remove the Income:Ebay -5 USD and take that from Dave’s debt account directly. However, at the end of the month beancount will report $20 of revenue while ebay’s statement will report the full $25. Matching these numbers is important to me. What I need to do is: Keep a record of Assets:Inventory as an intermediary between Dave’s debt and my other Assets. Keep a record of Expenses:COGS (Cost Of Goods Sold) to sink Dave’s transferred inventory into once sold. Note the additional transaction here: 2021-07-19 * "Chipotle" "Dinner w/Dave" Liabilities:AmEx:Blue -30 USD Assets:Debts:Dave 15 USD Expenses:Dining 15 USD ; ; Dave's debt is officially reduced here: ; 2021-07-30 * "Dave gives me his things to sell" Assets:Inventory 5 USD Assets:Debts:Dave 2021-07-30 * "ebay" "payment ; sold $20 of my things and $5 of dave's" Assets:Bank 25 USD Income:Ebay -25 USD ; my stuff + Dave's $5 item Assets:Inventory -5 USD Expenses:COGS 5 USD For future debts I will need to determine the price of our asset transaction ($5) after the item is sold. Quick dose of nostalgia, when googling beancount COGS, a wiki for Toontown is the first result. Fun times. Interesting plugin for deeper Fava integration: https://github.com/ROCHK/fava_inventory