miércoles, 25 de septiembre de 2019

Dark firefox even in "text" urls

I've been using dark reader for some time and I'm quite happy with it. Not a huge memory hog (just sometimes) and works pretty decently everywhere.

But I just discovered https://fedidat.com/640-dark-newtab-firefox/, where it tells how to darken also new tabs and urls with text mimetype

You just have to open about:config and set both browser.display.background_color and browser.display.foreground_color  to something that makes sense.

lunes, 9 de septiembre de 2019

set -e in bash subshell

Did you ever realize that even when you use `set -e` in a bash script, anything that happens inside a  $(subshell like that) won't be executed under the `set -e` umbrella?


Here are the 2 solutions we found. None feels very solid... but hey, it's bash, what did you expect?

- https://lists.gnu.org/archive/html/bug-bash/2008-01/msg00121.html . Apparently traps work in this dynamic scope and they get access to the nesting level of the bash shell the code is called from. Kind of not unwinding the stack?

- https://unix.stackexchange.com/questions/65532/why-does-set-e-not-work-inside-subshells-with-parenthesis-followed-by-an-or .  running the subshell as a background task and immediately waiting for it, like a 1process forkjoin.  Nuts.

lunes, 2 de septiembre de 2019

Migrating from vim (proficent) to emacs

In HN's thread about 26.3 being released (Congrats!), there's this guy  explaining that being already quite confortable with vim, it's too much of a commitment to move to emacs.

I remember the frustration when coming to emacs from an advanced vimmer POV: no "yyp"? no ":%s/foo/bar"? imap? But here's what I answered him:

As this is not an overnight conversion and you are quite proficent with vim already, my advice is to:
- Get used to type "emacs file.txt" instead of "vim file.txt" in your console.
- Have a function in emacs that opens the current file in vim for those moments where you just want your trusted environment. Writing it by yourself is a good focused learning experience.
This way you'll decide (and balance) how much you want to learn every day, and little by little you'll find yourself using that function less and less.

And I think this goes very well with my other "bootstrap your emacs lisp learning".

It's the same approach to most of my development (and life) efforts.  It's a function of how bad do you need it, how fast do you want it, the compound interest of starting early, and how much it slows you down (or blocks you for doing other things).