Jim Cheung

Tuesday, November 01, 2022

Nushell looks quite interesting, will try it

an introduction: Nushell: Introduction to a new kind of shell

I use Babashka for complex scripting, but shell is just like a repl, you can't beat the repl


how many bundlers do we need? I'll try to avoid products from Vercel for sure: Is Turbopack really 10x Faster than Vite?


tried use mdBook as documentation site for a small project I like its structure is simple, and most importantly it has search feature built-in

I wrote a bash script to grep comments in code and generate markdown files and a toc, and that's it

I also added badboy/mdbook-mermaid: A preprocessor for mdbook to add mermaid support, super cool

funny that just another day I read John Ousterhout's A Philosophy of Software Design, Chapter 15, Write the comments first this tool is perfect for that

he did a se radio episode: Episode 520: John Ousterhout on A Philosophy of Software Design : Software Engineering Radio


a Dockerfile for pkg, the trick here is the cache path, without it, pkg will try to download the base binary everytime

FROM node:16-slim
ARG PKG_CACHE_PATH=/cache/.pkg-cache
RUN npm i -g pkg pkg-fetch && npm cache clean --force
RUN pkg-fetch -n node16 -p macos -a x64 && pkg-fetch -n node16 -p linux -a x64

Thursday, November 03, 2022

trying nushell, I really like it, simple and fast, and it has something like dataframe

not quite ready to use it as login shell yet, just fire it from bash

I think it will be a good replacement for bash scripts


Announcing Grafana Phlare, the open source database for continuous profiling at massive scale

in the discussion someone mentioned pyroscope, and I tried it, also a simple plug and play tool, good for quick server side profiling

Monday, November 07, 2022

ported a script to nushell, I like it so far, and the outcome is easier to read than bash version, some notes:

fallback value for a missing environment variable:

($env | get -i FOO | default 'foo')

cd some-dir; do something can be done by:

(with-env [PWD $some-dir] { do something })

you can call external command like this ^find ... | lines

regex is just =~ or !~ following with pattern

the parse and path parse commands are very useful

to ignore stderr like bash did with 2>/dev/null:

(do -i { do something })

-i means ignore

Tuesday, November 08, 2022

The push for GATs stabilization | Rust Blog

explainlikeimfive version

understanding higher-kinded types

there's also a chapter in Programming with Types: Chapter 11. Higher kinded types and beyond


some interesting js reads:

and may give a try on ReactiveX/IxJS, it's rxjs for iterables

Blog Archive