Skip to main content

builtin diff command

· One min read

-u flag

Creates a "unified" diff view that plays nicely with the diff lexer in code blocks, for example:

--- ./path/to/left-side ...
+++ ./path/to/right-side ...
foo
+ bar
- baz
quux

Moment.js

· One min read
  • Moment.js is a JavaScript DateTime library
  • Quasi-superceeded by [[Luxon]] (by the same maintainers, in the Moment GitHub Org)
    • Obsidian plugins seem to use [[Luxon]] more and more.

Tokens I use most often

These are the tokens I use most often, mostly for configuring plugins like Periodic Notes and Templater templates.

  • 4-digit year: YYYY
  • 4-digit locale year: gggg
    • Relevant for formatting Weeks. Locale vs. ISO changes what day the week starts
  • 2-digit month: MM
  • 2-digit day of month: DD
  • 2-digit week: ww

And some recipes:

  • year-month-day: YYYY-MM-DD
  • year-month: YYYY-MM
    • useful for monthly folder notes that adhere to the Unique Name Assumption
  • year-week: gggg-[W]ww
    • the brackets are for literals
    • looks like 2025-W25

References

Obsidian assumes your note names are unique

· 2 min read

Obsidian makes some assumptions about the shape of your notes. One of those assumptions is that the names of your notes (i.e. the basename of the file without the .md extension) is unique across your vault, regardless of which folder it's in. In fact, many people recommend using Obsidian without folders at all. There is also a unique note core plugin that creates notes with a time stamp prefix.

I would say this is a "soft" assumption, meaning that you don't have to follow it, but Obsidian will be easier to use if you do.

A whirlwind tour of the PARA Method

· 5 min read

I have been using a version of the PARA method for a few years now. It is what has worked better for my brain than other methods. This post is aimed generally at anyone interested in note taking methods, and specifically at a co-worker who asked about the note taking method I use like a month ago. (Sorry for the delay, $COWORKER. Hopefully this is still useful.) There are plenty of articles and videos that go over the method, so I could just share one of those. Unfortunately, many of them cover only the main folders, and skip the information that explains how it actually works in practice. I will try to fill in some of those gaps.

Take better developer notes with Obsidian.md

· 11 min read

This post is for software developers who don't currently think much about their notes. You may take notes, but don't think of it as a "note taking system", and have probably never heard the term "Personal Knowledge Management".

I have 3 goals with this post

  1. Convince you that you should start a note taking system
  2. Explain why I recommend Obsidian specifically for that purpose
  3. Provide some tips to help you get started creating your system in Obsidian

Double-click to Select

· One min read

In most programs, you can double click text to select a contiguous block of text. That is, the text between delimiters.

What counts as "contiguous" has a lot of overlap with what is a valid identifier in most programming languages.

Spaces and most punctuation are nearly always treated as delimiters. This means the individual components of a [[PascalCase]] string are treated as a single block. Underscores--which are perhaps logically delimiters--usually extend the block, so [[snake_case]] strings are treated as a single block as well. With some exceptions, the components of a [[kebab-case]] string are treated as individual blocks.

So for example, given the natural language string "foo bar baz quux", the following table shows the final text that would be selected if you double click on the word "bar"

casestringselected substring
natural languagefoo bar baz quuxbar
kebab-casefoo-bar-baz-quuxbar
snake_casefoo_bar_baz_quuxfoo_bar_baz_quux
PascalCaseFooBarBazQuuxFooBarBazQuux

Further Reading

  • [[NamingConventions|Naming Conventions]]

Concurrency in Golang

· One min read

Golang's init() function

· One min read
  • automatically called once per package, the first time it's imported
  • cannot rely on order of exec when importing multiple packages that have init() functions

References

Front Matter Title (Obsidian Plugin)

· 2 min read

This plugin allows you to define the title of a note via front matter.

Without the plugin

In out-of-the-box Obsidian, the title of a note is the base name of the file (e.g. if the path is parent-folder/sub-folder/child-note.md then the title is child-note). This title then shows up in a bunch of places, including:

  • the Quick Switcher (i.e. when you hit ⌘+O),
  • the Graph View
  • the Explorer
  • Canvases
  • Tab titles
  • Bookmarks

Obsidian also lets you define aliases for a note via the aliases property. These aliases will appear in a few places, most prominently the Quick Switcher and Unlinked Mentions.

With the plugin

You can define main template and a fallback templates. These can get pretty complicated, allowing you to use multiple front matter properties, the basename, and the first heading.

I use title and aliases[0] for my main and fallback templates respectively, and recommend you do the same, unless you have specific needs. It's simple. It has the best synergy with other plugins, and it avoids some weird behavior with other options.

Aside: When I first started using the plugin, I used #heading, but that has some quirks. First, it means "first heading of any level", not "first H1", so if you don't already set H1s, and enable it in an existing vault, you probably won't get the title you intended. Also, the Excalidraw Plugin currently sets a hardcoded H1 of "Excalidraw Data".

Whatever template you use, the resulting title will appear in the places mentioned (although, these can each be toggled individually).

Synergy with other plugins

  • [[2024-07-26-waypoint-plugin]]
    • Must use the title property
    • Only supported on standard notes. Folder Notes still use the out-of-the-box title.
  • [[DataView (Obsidian Plugin)]]
    • use default(this.title, this.file.name) in your queries to snag the title property for notes that have it, and fallback to the file's basename