Recent Changes

Updates since 2022-01-17 20:17 UTC

1 | 3 | 7 | 30 | 90 days
List all changes Include rollbacks Include minor changes
List later changes RSS RSS with pages RSS with pages and diff


  • 10:50 UTC (new) (history) 2022-05-16 Two simple helpers for debugging Express.js applications . . . . mbork Sometimes, when debugging Express.js applications, it happens that one of the many middlewares for some route is misbehaving and either redirects to somewhere it shouldn’t, hangs or something like this, resulting in a 500. While it is possible to attach a debugger to Node.js, a good ol’ console.log is often an easy and fast way to find a culprit. Especially with this very simple middleware:


  • 16:59 UTC (new) (history) 2022-05-09 My productivity system - implementation . . . . mbork Last year I wrote about the design of my personal productivity system, and promised to describe my implementation. I have to admit I am not very satisfied with it, but I’ve been using it for over half a year now and it works (well, sort of). Its main advantage is its simplicity – I only needed to wrote about 100 lines of Elisp to handle it. So, here is the idea.


  • 16:47 UTC (new) (history) 2021-05-02 Org-mode to Markdown via the clipboard . . . . mbork Some time ago I have written about transforming stuff while copying it from Emacs to the system clipboard. Recently, I noticed that I sometimes write something in Org-mode only to subsequently copy it to some place which accepts Markdown formatting. So, I decided to write a simple function transforming the region in Org-mode syntax to Markdown.


  • 15:08 UTC (new) (history) 2022-04-25 Calculating fuel consumption in Org . . . . mbork While I am a big fan of Org-mode, I admit that I don’t try to use it for everything. Having used it for over ten years now I am aware that it is not the answer to everything – not even everything related to time-management. That said, it has quite a few unique features which make it very well suited to some specific needs. Some time ago, I decided to make a very simple fuel consumption calculator. A natural choice for most tech-savvy people would be to use a spreadsheet. I thought, why not use Org-mode? So, I came up with this table.


  • 05:09 UTC (new) (history) 2022-04-17 Easter 2022 . . . . mbork Another difficult time – not only because of COVID-19 (which hopefully seems to finally retreat), but now also war in Ukraine. I honestly cannot imagine what Ukrainian people live through. Though I also think about Russians – often, when someone hurts other people, the aggressor ends up suffering, too… Still, the Good News about Christ living yesterday, and to day, and for ever means that all suffering, however terrible, will come to an end. I pray for all the people suffering because of various reasons – which in fact means all people – and I hope to meet you all in Heaven some day. And even amidst all the suffering and pain we have this one reason for joy greater than all our troubles. Christ lives!


  • 05:38 UTC (new) (history) 2022-04-11 pgrep, or what I do when Vagrant hangs . . . . mbork I use Virtualbox (via Vagrant) pretty extensively. Unfortunately, sometimes it just hangs. (Two cases when it tends to happen is when I put my laptop to sleep with the VM on or when I try to run too many things on the VM. Not every time, but often enough to be a nuisance – say, maybe once a month. And given that I regularly have uptime on the order of weeks – Emacs uptime, not computer uptime, mind you;-), though in my case it is usually almost the same), I don’t want to reboot the system. Unfortunately, in such situations even vagrant halt --force doesn’t help.
  • 05:37 UTC (diff) (history) Comments on 2022-04-04 Warning about trying to setq a non-existent variable . . . . mbork Well, a function would require me to quote the variable name (unlike {{{setq}}} and unlike my macro).


  • 17:28 UTC (new) (history) 2022-04-04 Warning about trying to setq a non-existent variable . . . . mbork Some time ago I wrote about how I changed a value of one of Emacs’ internal variables to get the behavior I needed. As I mentioned, I submitted a bug report (apparently, I’m in a minority needing this, and I don’t expect it to be fixed in near future – but that doesn’t bother me much, since I have the workaround in place anyway). There is one thing that does bother me, though. If this bug gets solved at some point in time, and the variable js--declaration-keyword-re disappears (and some other one – without the two dashes – is created in its place), how do I know that?


  • 12:29 UTC (new) (history) 2022-03-26 A nice use-case for pee . . . . mbork Well, sorry for the click-bait-ish title;-)… Of course I meant this pee. It is similar to tee in that it can “split” the input stream, but while tee directs it to a few files (by default to stdout and to the given ones), pee directs it to pipes. You can give it names of commands and it will run them in succession and feed every one of them its input. (Unlike tee, it doesn’t put it to stdout, so you need an explicit cat to achieve that.) Here is a nice use-case.


  • 06:18 UTC (new) (history) 2022-03-19 Variable-width font in the modeline . . . . mbork Some time ago there was an experimental change on the master branch in Emacs, bringing “variable width” fonts to the modeline. The main problem with them is of course the fact that when a part of modeline on the left changed (even without changing the number of characters), the rest of it would “jump” because the width of the changed portion would not be constant anymore. Well, that is now fixed: such things now have a fixed width, so changing the modeline font to a variable-width one works very well.


  • 16:47 UTC (new) (history) 2022-03-14 Proper indentation after a const in Emacs . . . . mbork A few days ago I decided to finally fix one of the issues I had with JavaScript indentation in Emacs (in the default js-mode – I use js2-mode, which delegates indentation to js-mode). When using const to declare variables, and the declaration not fitting in one line, the indentation of the next line was broken...


  • 05:53 UTC (new) (history) 2022-03-07 Transient input method . . . . mbork A long time ago I wrote about my usage of the TeX inout method, which is great for entering mathematical Unicode characters not present on the keyboard. Of course, I don’t have it on all the time...


  • 18:56 UTC (new) (history) 2022-02-28 A clever trick with psql copy and multiline select statements . . . . mbork For today, I have another PostgreSQL tip, which I admit is extremely niche, but useful nevertheless. As I mentioned a few times, I’m a big fan of psql. One of the nice things it has to offer is the \copy command. It is a very thin wrapper around SQL’s copy command, with an important change: it generates files on the local filesystem, and they are owned by the user who runs psql, not the postgres user (under whom the PostgreSQL server operates). However, \copy does not accept multiline queries, which is a pain if you have a long, nicely formatted query and you just want to feed it to \copy to get a result e.g. as a csv file.


  • 04:46 UTC (new) (history) 2022-02-21 Graph plotting in TikZ – a caveat . . . . mbork Yet another TeX tip today – I found I wrote this over 6 years ago and never published. So, here it is. When I need to plot function graphs, the excellent TikZ package is usually my go-to solution. While I really do like TikZ, I have to say it had a nasty surprise for me.


  • 10:28 UTC (new) (history) 2022-02-12 tomato.el update . . . . mbork Last year I wrote about my pomodoro-like setup with Org-mode. Since then I tweaked that a little bit and decided to share the updated code.


  • 08:03 UTC (new) (history) 2022-02-07 An inclined plane in tikz . . . . mbork Look, a TeX post again! It’s been another while since I last wrote anything TeX-y here. No wonder, I hardly ever use TeX anymore – but I still do use it from time to time! A few days ago I needed to draw a diagram of an inclined plane. Interestingly, there are people who did exactly that using TikZ before (obviously), but two examples I found used the heavy artillery of trigonometry.


  • 09:56 UTC (new) (history) 2022-01-29 Running a script before (and after) starting the psql prompt . . . . mbork And here I am again, with another PostgreSQL tip. Recently, I had a need of running psql interactively but executing some script first. Of course, this can be done from psql itself by saying \i some-script.psql, but let’s assume that I’d prefer for that to happen automatically, so that instead of typing psql at the shell prompt and then \i some-script.psql at the psql prompt I could just say at the shell prompt and be done. The important thing here is that I want to run some-script.psql first and go to the psql prompt next.


  • 16:26 UTC (new) (history) 2022-01-24 Journaling with Org-mode . . . . mbork OK, so let’s admit it. I’ve been journaling with Org-mode for more than 6½ years now. Every day (well, almost every day) I sit down and make notes of important things that happened that day.