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
In my opinion, there are 3 types of useful bookmarks when surfing the web. Temporary Long-Term + Archival Startpage + Frequently Visited Unfortunately, web browsers only competently support the temporary kind. It’s silly to cram all 3 use cases into this one solution. Luckily, people have created a number of tools to fill in the gaps. These are the bookmarking tools I use and when. Temporary “I’ll need this in the next 1-3 days” This is the most common for me. I use Firefox’s standard bookmarking feature for this. Ctrl+D and done. Long-Term + Archival “I might need this someday” I collect some links because they’re useful, or cool, or just something else entirely. I want to hold onto them where I know I can find them later, but don’t want to crowd my “short term memory” of temporary links. For this, I use Linkace. It submits each link to the archive.org wayback machine for backup if the linked site ever disappears. Tags, lists, and sorting all make this a better option that browser bookmarks. Plus, you can export your hundreds of links as a browser-compatible .html file anyway. Startpage + Frequently Visited “I visit these 3+ times per day” These I want to have on hand quickly. Think Reddit, HN, YouTube, etc. I also lump local server tools like Proxmox, analytics dashboards, and self-hosted services into this one. These links are too permanent to be in the “Temporary” bookmarks bar, but also too general to be filed into a link collection. For this I use my custom startpage: Salient Startpage. This page is a list of links that I load on every new browser tab to quickly access my favorite sites.
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
Beets is an incredible tool for organizing a local music library. It’s a little geeky, but does such a stellar job integrating metadata from MusicBrainz with auto-matching, album art, lyrics, etc. It supports deduplication, transcoding, and much more with plugins. Anyone with an appreciation of local music and infra-as-code would be in paradise. I just hit over 10k songs, which is managed like a dream: ❯ beet stats Tracks: 10008 Total time: 3.9 weeks Approximate total size: 63.9 GiB Artists: 2754 Albums: 2016 Album artists: 1280 Beets imports music, adding embedded lyrics/artwork and correct tags all automatically. But it also has a few useful commands I use variations of all the time: List entire library sorted by ascending bitrate: beet ls -f '$bitrate $artist - $title' bitrate+ Scan the library filesystem for additions/removals, update tags from MB: beet update Using the plugin oldestdate, update the year field of Andrews Sisters tracks to the original recording year (~1940s rather than the remastered album date in the ~2000s): beet oldestdate Andrews Sisters Set the genre of any track with field containing “celtic” to “Celtic”: beet modify celtic genre="Celtic" Using the plugin smartplaylist, automatically update and export m3u playlists based on my config. beet splupdate Here is my entire beets config, including dynamic playlists: directory: ~/Music/songs library: ~/Music/beets.db import: move: yes detail: yes write: yes # quiet_fallback: asis # duplicate_action: skip # match: # strong_rec_thresh: 0 paths: singleton: $artist/$title plugins: - badfiles # - chroma # - convert - duplicates - embedart # - fetchart - fish - info - inline - lastgenre - lyrics - mbsync - missing # - oldestdate - playlist - smartplaylist # - thumbnails - random # - describe lastgenre: source: track force: yes canonical: ~/Music/genres-tree.yaml whitelist: ~/Music/genres.txt item_fields: decade: str(year)[0:3]+"0s" embedart: quality: 75 oldestdate: auto: no ignore_track_id: yes filter_on_import: yes prompt_missing_work_id: yes force: yes overwrite_year: yes filter_recordings: yes approach: "releases" musicbrainz: searchlimit: 20 genres: yes # convert: # auto: no lyrics: google_API_key: 'AIzaSyD_H92ZLd6syQ17JEBoiFQxXPgMM7TNLDA' sources: 'google genius tekstowo musixmatch' force: yes fallback: '' acoustid: apikey: 5Mow8bcd6a smartplaylist: auto: no relative_to: ~/Music/lists playlist_dir: ~/Music/lists playlists: - name: "1900s.m3u" query: 'added- year::(19[0-4][0-9]) ^"genre::(Classical|Lo-Fi|Ambient|Opera|Salsa|Early Music|World Music|Bossa Nova|Celtic|Flamenco|Bitpop|Soundtrack|Tango|Italian|World|Tropical|Cuban|Reggae|Samba|Bluegrass|Cuban|Monk|Calypso|Baroque|Neofolk|Comedy|Koto|Chillout|Downtempo)", Louis Armstrong , Tony Benett , Bobby Darin , Carlos Antonio Jobim' # 1900 - 1970, includes Jazz # 1980-2010, does not include Jazz - name: "$decade.m3u" query: - 'year::(19[5-7][0-9]) "genre::(Jazz|Country|Bluegrass|Country Pop|Easy Listening|Folk|Ragtime|Smooth Jazz|Swing|Pop|Rhythm and Blues|Soul|Rock|Alternative Rock|Reggae|Ska)"' - 'year::(19[8-9][0-9]) "genre::(Easy Listening|Electronic|Disco|Downtempo|Electronica|Techno|House|Trance|Folk|Hip Hop|Pop|Dream Pop|Rhythm and Blues|Funk|Soul|Rock|Alternative Rock|Hard Rock|Punk Rock|Reggae|Dancehall|Ska|Swing)"' - 'added- year::(20[0-9][0-9]) "genre::(Easy Listening|Electronic|Disco|Downtempo|Electronica|Techno|House|Trance|Folk|Hip Hop|Pop|Dream Pop|Rhythm and Blues|Funk|Soul|Rock|Alternative Rock|Hard Rock|Punk Rock|Reggae|Dancehall|Ska|Swing)"' - name: "Pop - Party like its 2012.m3u" query: year:2006..2012 "genre::(Electronic|Disco|Electronica|Techno|House|Trance|Hip Hop|Pop|Funk|Rock|Alternative Rock|Hard Rock|Punk Rock|Reggae|Swing)" - name: "Rock - Adore Alliteration.m3u" query: ['genre::Hard\ Rock added-', 'Rock|Classic\ Rock', Jack White, Def Leppard, AC/DC, Rage Against the Machine , paris texas , well wasted, trails shake] - name: "Quiet - Books & Tea.m3u" album_query: "Bach for Book Lovers, Bach for Breakfast, Debussy, Mozart, Vivaldi" - name: "Chill - By The Pond.m3u" album_query: "Pomplamoose , The Avener , Dansu , HONNE , Anne Murray , The Doobie Brothers , Weezer island , slightly stoopid , george harrison , billy joel , hard day night , louis armstrong hello , Fleetwood Mac Dreams , chasing pirates , Parcels , john mayer new light , shura touch , vitor kley , that life unknown mortal, Forrest , arlo parks , disco yes , around the sun poolside , unknown mortal orchestra , Gorillaz, 'genre::Soft\ Rock', 'genre::Dream\ Pop'" - name: "Rock - Two Feets.m3u" query: "Two Feet, Adam Jensen, Arctic Monkeys, Gorillaz, Emmit Fenn, Ellise, Stellar, Dennis Lloyd , Sub Urban , Chloe Adams , one hope ghost , peach pit , elderbrook , the people thieves , joywave , UPSAHL , yeek" - name: "Pop - Bad Bunnies.m3u" query: "Bad Bunny, J Balvin willy william , lele pons , drinkee , matadora tukker , tukker swing , mon cheri , kakee tukker, Arcángel" - name: "Calm - Piano.m3u" album_query: [ 'piano ^"genere::(Pop|Classic\ Rock)" ^"artist::(Billy Joel)"', "chopin, In the Mood for Debussy, the ultimate most relaxing new age music in the universe", ] - name: "Calm - Otherworldly.m3u" query: "relax with nature, symphonies of the planets" - name: "Pop - Swingtown.m3u" album_query: 'Parov Stelar , Nekta, Caravan Palace , Jamie Berry , Caro Emerald , Alice Francis , Paloma Faith , Sim Gretina , Waldeck , Soul Square , "genre::(Electro-Swing|Cabaret)" , Belleruche , Mr. Scruff , Tape Five , Jojo , Kormac , free the robots , ProleteR , Electric Swing Circus' - name: "World - Guitar and Tapas.m3u" album_query: ['guitar "genre::(Classical|Flamenco)"', "genre::(Flamenco)", "Gábor Szabó", Armik , Concha Buika , David De Alva , Gipsy Kings , Jesse Cook , Lhasa de Sela , Nicolas Hernandez , One Day Deep , Strunz & Farah , Maria Rita , Gotan Project, Gábor Szabó] #- name: "Christmas.m3u" # query: "christmas , chimpmunk , smooth carols , reindeer , santa , happy holiday " - name: "Chill - Chill Dope.m3u" query: "'artist::(Men I Trust)' , nombe , title:Sadnecessary , waves probz , post malone - circles slowed , YAS empty crown, slenderbodies, Shura , BENEE , Magdalena Bay" - name: "Chill - Chill Hop.m3u" query: 'artist::(Jungle|Monsune|Cannons), Glass Animals, anderson .paak , duckwrth , easy life have a great day , softcore neighbourhood , christian kuria , b-ahwe, king mala , sad night dynamite , tanglewood , equation , nombe , paper idol hey you , griz keep, audrey nuna' # don't include Denzel curry with GA - name: "Calm - Calm Spirit.m3u" query: "Israel Kamakawiwoʻole, alturas, Melody Gardot" - name: "Pop - Too Many Beaches.m3u" query: "bob marley , calvin harris 18 , Kauai , Edward maya , Jason Mraz , kala paper planes , stolen dance , artist:'will smith' , summertime ^'artist::(Billie Holiday)' , skizzy mars , miller the joker , miller airliner , artist::(^UB40$) , P.I.M.P , TaKillya , jimmy buffet , poolside , sun is shining , beach boys , American boy kanye , Martin Solveig , tieduprightnow , kid Francescoli , Dennis Lloyd , bad boy yung bae , girl like me black eyed peas , around the sun poolside , a good night john legend, like sugar chaka , castles paper idol , benee soaked , benee island , disfruto carla morrison , vallis alps , parra for cuva , silver linings easy life" - name: "World - Spanish Succulents.m3u" query: "Lifescapes cancun , Lifescapes mexico , Lifescapes spanish , Lifescapes latin , Suzana Salles , just relax mexico" - name: "World - Bossa Nova.m3u" query: "Bossa nova" - name: "Rap - DXM Dumb.m3u" query: "yung gravy , womp womp , bbno$ , drugs tai , tyga , anaconda , joey purp , Aminé , Post Malone wow, faucet failure , saweetie , ceo@business.net" - name: "Electric - LSD & XTC.m3u" query: "Basshunter , deadmau5, Benny Benassi , AronChupa , The Chainsmokers , The Glitch Mob , Jamrock , Keys N Krates , I took a pill in ibiza , ODESZA , Redlight X Colour , GlitchHop , artist:'tove lo' , Tropkillaz , How to Be a Human Being life itself , SAINt JHN , Overmono , Bonobo , Romare gone , Caribou home , tones dance monkey , GOMF , Tiesto , ZHU , Music Sounds Better With You , The Glitch Mob , Galwaro , Fatboy Slim , The Prodigy , Calvin Harris , Daft Punk , The Blaze territory , kid Francescoli , nightswimX , Adam Jensen grudge , Lemaitre , Crypto faded , Airmow, big wild when I get there , mirror masa , moonlight Gaullin , daredevil 'artist::stellar' , 'artist::crypto' , going insane heuse , infinity ink , dancin aaron smith, rouge airmow , pon de replay ed marquis , ghosts jacob , little more love aj tracey , duke dumont , elderbrook , regard , sofi tukker , twocolors , good ones xcx , REZZ , frozen madonna , wolfe skeletons , zeds dead , carla morrison , emma peters , ya nina , astrality , SLH, volb3x, Camel Milk , mbnn, AREZRA , Night Club, Nicolar Jaar, Barış Çakır, party favor" - name: "Electric - Cyberpunk.m3u" query: "Gesaffelstein , DJ Hyper, REZZ spiral" - name: "Pop - Bear St.m3u" query: "Kygo , Tove Lo , K.Flay , All my friends , Tate McRae, Snakehips , Two Feet , 'artist::Stellar', Tokyo Project , moonlight Gaullin , james bond paper idol , Badunkadunk , Diana Goldberg , 2 man embassy , MORTEN beautiful heartbeat , surf mesa , taska black , mazde , coconuts kim petras, Lewis Ofman, mbnn , lucas estrada , charlie xcx , MIA GLADSTONE" - name: "Calm - Reign.m3u" query: "Jack Johnson , Gordon Lightfoot , John Mayer battle studies , Sam Smith , norah jones sinkin soon , David Gray , Ed Sheeran lego , Wayne how to love , Michael Franti , probz waves , artist::(Passenger) , Melody Gardot , Milky Chance , sweater weather , Grape Soda, billie eilish bury a friend, billie eilish lost cause, billie eilish happier than ever, biig piig , dodie" - name: "Calm - Autumn Red Leaves and Streetlamps.m3u" query: "Vince Guaraldi, louis armstrong" - name: "Calm - Just Fine.m3u" query: "Norah Jones come away , willie nelson stardust , simon garfunkel , 'artist::(Carpenters)' , Anne Murray , Melody Gardot , bread diary , ella fitzgerald louis armstrong , james taylor , emily watts" - name: "Pop - Slut Pop.m3u" query: "added- Britney Spears , artist:DNCE , Carly Rae Jepsen, Justin Timberlake , Jennifer Lopez , Gwen Stefani , Fifth Harmony , Kat Dahlia , Katy Perry , Kesha , Meghan Trainor , Kylie Minogue , Madonna , Selena Gomez , Kim Petras , qveen herby , tove lo , poppy fashion , mistress violet , EMELINE , Cobrah" - name: "Pop - Rapsmiths.m3u" query: "Aesop Rock impossible , Eminem curtian call , j cole born sinner , Kanye West all falls , Kanye West my beautiful , Kendrick Lamar damn , The Notorious B.I.G , tierra wack" - name: "Calm - Ketamine Dreams.m3u" query: "Iron & Wine , John Mayer battle studies , Norah jones day breaks , Fleetwood Mac future , Melody Gardot , U2 Joshua Tree , massive attack , post malone - circles slowed , two feet bitch, two feet her life" - name: "World - Happy in Havana.m3u" query: "Buena Vista Social Club , Cubanismo , Putumayo , Afro-Cuban , genre::(Cuban)" - name: "World - Time for Dessert.m3u" query: "Rabih Abou-Khalil , Uncharted , Niyaz , Azam Ali , Lebanese Blonde , Feast of Silence , Trio Globo" - name: "Calm - Jazz Minus People.m3u" query: "Contemporary Smooth Jazz , VooDooBop" - name: "Pop - French Pop.m3u" query: "L’Impératrice , Angèle , artist::(Paradis) , Claire Laffut , ELI ROSE , Dimie Cat , pomplamoose jean-marie , Stromae, mon cheri" - name: "Pop - French.m3u" query: "Édith Piaf , peyroux" - name: "Rap - Golden 2000s.m3u" query: 'year:1998..2008 "genre::(Rap|Hip\ Hop)" ^"genre::(Classical)" ^"artist::(Aesop Rock)"' - name: "Electric - Headspace.m3u" query: "Alina Baraz , The Beatles tripper , The Beatles strawberry , Built On Glass , The Cure Lullaby , Dim Sum , Flock of Seagulls , K.Flay , Kendrick Lamar PRIDE , Lost Frequencies , Steve Baker , Mari Ferrari , 'artist:The Neighbourhood' , NoMBe , MGMT pretend , Rudimental , Snakehips , Snoop Dogg peaches , SoySauce , St. South , Kiiara , Prayer In C , Kygo , Faul, Wad Ad & Pnau , Tom Tom Club genius of love , Kali Uchis , kid Francescoli , La clé des champs, AViVA , Emeline , big wild when I get there , so high doja cat , she said big jet plane , brasstracks , emmit fenn , shura touch , two feet fire in my head , emmit fenn hollow , of the trees , my space robes , astrality" - name: "Calm - Evenings.m3u" query: "Chopin , yo ma, James Galway " - name: "Calm - Folk.m3u" query: "'artist::(Bread|Carole King|^Chicago$|Jim Croce|John Denver|Patsy Cline|Simon & Garfunkel|James Taylor)'" - name: "Calm - Daffodils in my Dandruff.m3u" query: "The Supremes , Elvis Prestley , Forrest Gump , Everly Brothers , Lynyrd Skynyrd , The Mamas & The Papas , Mama Cass" - name: "Rock - Chalk.m3u" query: "OneRepublic , Paramore , Sublime , Hot Chelle Rae , Blink-182 , The Offspring , weezer , Radiohead , ZZ Top grange , 3 Doors Down , Heroic , keyframe , Gorillaz , Slightly Stoopid , Max Armfield , Smashing Pumpkins , March to the Grave , Banjax , Courtney Barnett, radiohead" - name: "Electric Firmly Grasp It.m3u" query: "Allie X , good ones xcx , talk about me justin , enchanted waterfall , CloZee, roudeep , shallou , never dull , palms trax , tanglewood , equation , KastomariN , artist::Alef, Ozen Arslantas , Crisologo , PLÜM , Roudeep , grimes, forty cats, Nicolar Jaar"