Weekly review: Week ending August 20, 2021

| review, weekly
  • I converted details to an 11ty shortcode for easier tweaking.
  • I converted more of my sketch links to use my shortcode. Hooray for Emacs, wgrep, and 11ty!
  • I added an EmacsWiki page about Emacs coaching, and I edited a few more event-related pages.
  • I practised lettering and sketchnoted a menu of activities. A- found the lettering examples very interesting and kept encouraging me to do more.
  • A- wants to learn cursive. I decided to learn brush lettering at the same time, so we both get to work on our fine motor skills.
  • We followed some instructions to fold a paper airplane that's like a bat. I liked the way it flapped its wings.

Blog posts

Sketches

Time
Category The other week % Last week % Diff % h/wk Diff h/wk
Unpaid work 3.8 6.1 2.2 10.2 3.8
Discretionary - Productive 5.9 7.7 1.8 12.9 3.1
Sleep 32.4 33.7 1.3 56.6 2.2
Personal 5.6 6.6 1.0 11.0 1.6
Business 1.6 2.4 0.8 4.0 1.4
Discretionary - Family 1.4 0.8 -0.5 1.4 -0.9
Discretionary - Play 2.2 0.5 -1.7 0.9 -2.9
A- 47.2 42.3 -4.9 71.0 -8.2
View or add comments

Kindergarten means I get to learn how to write, too

| drawing

A- wants to learn cursive, probably because it's extra-fancy and the sort of thing Elizabeth Bennet would have done. There's some support for teaching cursive in kindergarten, so it's not totally crazy. It's a good opportunity for me to improve my lettering skills, too. She usually likes it when we do the same thing at the same time, so working on letters together is a good way to nudge her to practise fine motor skills. We did a brush lettering worksheet for "Aa" from Amy Latta Creations. This one is my worksheet.

I've got lots to learn about controlling a brush pen. Doing lots of drills will probably help me get my up-strokes to be as thin as the samples.

A- often asks me to connect my letters. I think I'll make our own worksheets so that she can connect letters too.

At bedtime, I drew in my sketchbook while she read independently. When she noticed what I was doing, she said she liked the 3D letters and encouraged me to do more. She pointed to blank spaces on the page and suggested things to add.

Not that different compared to my lettering experiments from 2013:

But hey, I'm learning stuff!

View or add comments

Making a menu of activities

| sketchnotes, drawing, parenting, play

A- wants to be with me almost all the time. This can be challenging.

A multiple-choice question is easier than a fill-in-the-blank one, especially when it comes to "What do we do now?" A- seems less grumpy throughout the day when she can go from one activity to another of her choosing. I like letting her take the lead. I also like not having to come up with stuff. During bedtime, I sketched this menu:

View or add comments

Using the wgrep package in Emacs to rewrite grep results from lots of files

| 11ty, emacs

acdw let me know that my Emacs News links to https://reddit.com didn't work for him in Firefox on Linux, but that changing the links to https://www.reddit.com would make them work. I was glad that I had migrated my blog from Wordpress to the 11ty static site generator. All my blog posts were HTML files, and I could just whiz through them all.

In the past, I might have used find-dired or find-grep-dired to get a list of files. Then I would record a keyboard macro to open a file, search and replace the text, save the buffer, and then kill the buffer, and I would just repeat this macro until an error occurred.

Some time ago, I learned about using Q (dired-do-find-regexp-and-replace) in Dired to replace regular expressions in marked files, using Y to accept all the replacements. That would then let me use C-x s (save-some-buffers) to save all the modified buffers with !. The bufler package is handy for closing a whole bunch of buffers of a certain type, although ibuffer or helm can handle that too.

Emacs being Emacs, there's an even better way to do it. I used M-x grep to find the lines to change, the wgrep package to make the results editable, and M-x replace-string to change things. A quick C-c C-e (wgrep-finish-edit) later, and I was able to change 5485 matching lines in 302 files.

It's so nice being able to deal with things in plain text. Yay for Emacs! There's always something more to learn.

View or add comments

2021-08-16 Emacs news

| emacs, emacs-news

Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar and emacs-devel.

View or add comments

Started learning how to interactively debug Javascript in Emacs with Indium

| 11ty, emacs, coding

I noticed something strange in my static blog: my blogging category page didn't list my post on statically generating my blog with Eleventy. Now it does, of course, since I fixed it. But it didn't, and that was weird. I tried using console.log to debug it, but it was annoying to try to figure out the right thing to print out in a long list of nested objects. Besides, console.log debugging is so… last century.

Since these tips for debugging in 11ty mentioned interactively debugging things in VS Code, I decided it was a good time to learn how to use Indium, a Javascript development environment for Emacs.

(use-package indium :hook ((js2-mode . indium-interaction-mode)))

After some trial and error, this was the .indium.json file that allowed me to use M-x indium-launch to start the Eleventy process.

{
  "configurations": [
    {
      "name": "11ty",
      "type": "node",
      "program": "node",
      "args": "./node_modules/.bin/eleventy"
    }
  ]
}

I originally had "inspect-brk": true in it as well, following the suggested configuration, but I found it easier to just set breakpoints in my files using indium-add-breakpoint (C-c b b, a keybinding set up by indium-interaction-mode in my js2-mode-hook).

Conditional breakpoints didn't seem to work, so I just put my logic in an if and set my breakpoint in there.

  categories.forEach((item) => {
    if (item.slug == 'blogging') {
      let post = data.collections._posts.find(o => o.inputPath.match(/statically-generating-my-blog-with-eleventy/));
      console.log(post);
    }
    ...
  }

When I set my breakpoint on the let post... line and ran M-x indium-launch, I got an interactive debugger at that breakpoint. I could also switch to the REPL console and type stuff. Yay!

As it turned out, the post I wanted wasn't showing up in the list of posts. It was because I had used eleventyConfig.setTemplateFormats and forgotten to include md for Markdown files. Once I figured out what was going on, it was easy to fix. This is what the debugger looks like. It adds values to the ends of lines, and you can evaluate things.

Screenshot_20210816_002331.png

I'm looking forward to learning more about using Indium to debug scripts running in Node or Chrome. Slowly, slowly having some focused time to sharpen the saw!

If you use Emacs for Javascript development and you're curious about Indium, you can check out the documentation.

View or add comments

Weekly review: Week ending August 13, 2021

| review, weekly
  • I wrote a few 11ty shortcodes and Emacs commands to make sketches easier to embed into my blog posts.
  • We visited W-'s parents.
  • We made a LEGO vending machine, drink dispenser, and ATM following some video tutorials. A- made adorable beepboop sounds and pretended to cover her PIN.
  • We built and played with the LEGO Heartlake City Grand Hotel.
  • I used the LEGO power functions extension cables I ordered to connect the motors to the train regulator. Now the Great Ball Contraptions can run off wall power.

Blog posts

Sketches

Time
Category The other week % Last week % Diff % h/wk Diff h/wk
A- 39.1 47.2 8.1 79.2 13.6
Discretionary - Play 0.4 2.2 1.8 3.7 3.1
Discretionary - Productive 5.1 5.9 0.8 9.8 1.3
Business 1.1 1.6 0.5 2.6 0.8
Discretionary - Family 1.6 1.4 -0.2 2.3 -0.4
Sleep 34.4 32.4 -2.0 54.4 -3.3
Personal 7.6 5.6 -2.0 9.4 -3.3
Unpaid work 10.8 3.8 -7.0 6.4 -11.8
View or add comments