Hung-Yi’s Journal

Front-end Developer, Emacs Adventurer, Home Cook

07 May 2021

Sum an Array of Arrays Using JavaScript or TypeScript

I was recently asked what was the best way to sum up an array of arrays of numbers. While I'm not the best code golfer, I am rather lazy, so I do have some terse solutions up my sleeve.

02 Apr 2021

Split a List Into Batches Using Emacs Lisp

Sometimes a list of things is too large and it needs to be split into batches before it can be processed effectively. A quick google didn't reveal any quick copy-pastable elisp (a.k.a. Emacs Lisp) functions that did this kind of batching, so I cobbled together what I found and came up with this cl-loop implementation, which is hopefully performant.

17 Mar 2021

How to Quickly Get evil-mc Working With Smartparens

evil-mc is great for working with multiple cursors and smartparens is great for working with lispy s-expressions. But can they work nicely together without putting in a lot of effort writing glue between the two? Read on to find out.

03 Mar 2021

Convolute Lisp S-Expressions With Smartparens

"Convoluting a lisp s-expression" sounds like computer science ivory tower bollocks, but after I actually learned what it was and how to use it, I'm seeing it pop up quite regularly when writing lisp. Let me show you the magic; I promise every time you get to use it, you'll feel like a king!

01 Mar 2021

How to Emojify Selectrum Candidates

If you use both emacs-emojify and selectrum and you're having trouble getting emoji to show up properly in the list of completion candidates, especially after the latest round of selectrum updates (commit 21cee86) then I have an elisp configuration snippet that may help you. Read on to see it.