A list of small things I learn every day, documented chiefly for myself.

Escape Markdown Code Block Inside Markdown Code Block

You can escape Markdown code blocks by using four backticks (````) instead of three.

> Prevent Go Programs from Exiting

This _can be prevented_ by wrapping your code with a **channel**:

```go
c := make(chan bool) // creates a new channel
// your code goes here
<-c // perpetually waits for the channel to receive data
```

The above code block documents a Markdown code block. Very meta. It is created use four backticks:

````markdown

Everything CSS Flexbox

My working with CSS is mostly trying every value for a property until it does what I want it to do. This ignorance has only increased with free access to GitHub Copilot in my IDE, where I conveniently delegate CSS specifics to the AI.

But today, I found the BEST interactive tutorial about Flexbox. Even a quick look can help you intuitively understand how to use the Flexbox properly. Very good, very recommend.

Exclude Files and Folders from Front Matter CMS

To prevent Front Matter CMS from including specific files and folders, you can provide the paths to be excluded in excludePaths under frontMatter.content.pageFolders:

{
  "frontMatter.content.pageFolders": [
    {
      "title": "Posts",
      "path": "[[workspace]]/content/posts",
      "previewPath": "posts",
      "contentTypes": ["Post (default)"],
      "excludePaths": [
        "_*.*" // Exclude all files starting with an underscore
      ]
    }
  ]
}

I use this to exclude _index.md files from Front Matter.

Prevent Go Programs from Exiting

You can use channels to prevent Go programs from exiting.

I have found this to be useful when running Go + Wasm on the browser where I run into errors like:

wasm_exec.js:378 Uncaught Error: bad callback: Go program has already exited

This can be prevented by wrapping your code with a channel:

c := make(chan bool) // creates a new channel
// your code goes here
<-c // perpetually waits for the channel to receive data