Ken Huang
whatacold.bsky.social
Ken Huang
@whatacold.bsky.social
Falling in love with #clojure, #clojurescript, and #emacs. Building Chrome extensions and websites using them. C++ dev by day.

GitHub: http://github.com/whatacold
YouTube: https://www.youtube.com/@kenhuang-tech
Blog: https://whatacold.io
🥷 Clojure Pro Tip 4

In case you don’t know it, we can use raw strings, like embedding JS code, in hiccup.

I just found out we can use `raw` to prevent strings from getting escaped.

I should’ve found this at the beginning, as it’s mentioned on the homepage, but somehow I missed it.
May 15, 2025 at 2:21 PM
🥷 Clojure Pro Tip 3

Sometimes, we may want a few examples of a #clojure API for inspiration.

With #cider in #Emacs, we can run M-x cider-doc to see the docstring for the symbol. We can even use M-x cider-clojuredocs for examples if the symbol is from the language core.
April 29, 2025 at 4:01 PM
Clojure Pro Tip🥷 2

So you're more than excited to find out how #clojure thread macros can make code clean and concise, you just love it! But at some point you'll be trapped a bit as the threaded argument's positions are inconsistent using -> or ->>.

Luckily, you can use as-> (see the pic)
April 23, 2025 at 3:59 PM
It's amazingly easy to group things in #Clojure. The core provides a group-by function directly. Together with many built-in functions or key functions, it creates tons of possibilities, and we can also bake our grouping function if none is satisfying.

Example from github.com/functional-k...
April 18, 2025 at 1:43 PM
Clojure Pro Tip🥷

In #clojure, we can use comment for tests in development. However, since a comment evaluates to nil, you may run into surprising results/errors if you misuse it.

In these cases, you may tend to use ; to comment them out, but a better choice is to use the discard reader symbol #_.
April 5, 2025 at 6:44 AM
Clojure practice tip💡

Even if we might not have the opportunity to code in #clojure at work, we can still use it for ad-hoc scripting or proofs of concept. I promise it’s a lot of fun, thanks to the interactive development approach. We can try out ideas, building stuff bottom-up or top-down.
March 25, 2025 at 1:46 AM
Emacs Pro Tip🥷

Having too many buffers isn't good for switching buffers in #emacs.

After finishing a project, we'd better close all its buffers. How?
1. C-x C-b opens up ibuffer
2. Click at the top to sort by that column, or hit s f
3. Mark them by m, then hit D to close them
March 22, 2025 at 11:18 AM
😂Suffered one side effect of writing too much #clojure while opening an issue for libpython-clj, an incredible lib bridging clj and #python:

github.com/clj-python/l...
February 18, 2025 at 4:35 PM
Now my blog site starts to look more like one on #clojure and #emacs, when you click on one of the nav bar items, you're actually "calling" a function 😬:
whatacold.io
February 15, 2025 at 1:29 PM
It’s very nice that someone happened to buy me a cup of coffee while I’m planning to rewrite the website: texttoolkit.com, thanks! It was written using #flask years ago, time to brush it up a little bit.
February 12, 2025 at 4:57 AM
Finally, I get started using lein to set up a #compojure project. But then I got stuck on how to start an nREPL for #cider.

It turned out that there is an option in :ring, which somehow isn't mentioned in lein-ring's docs. I found out it thanks to this answer: stackoverflow.com/a/28759905
February 3, 2025 at 5:15 PM
Anyone had the experience to successfully publish a chrome extension in #clojurescript to chrome web store? Just noticed it says “Obfuscation is disallowed”, damn!

developer.chrome.com/docs/webstor...
January 18, 2025 at 3:46 AM