Here’s the JSON Feed

This blog now has a JSON Feed, so I can be added to Icaplanet!

Icaplanet is an old Planet, a feed aggregator, written by Oliver which used to aggregate many blogs from Ica-based friends, long before social media took over the internet. I believe things will go full circle someday and blogs will come back.

So, Oliver is reimplementing Icaplanet and he’s using JSON Feed instead of plain old RSS. The domain was about to expire and he asked me if he should renew it. I have other priorities right now, writing on my blog is not on my short-term plans, but I don’t want Icaplanet to go the 99ovejas.com way (that’s a story for another day) so I said yes and I might post sporadically, no promises.

Oh yeah, feed’s here: https://jgwong.org/blog/feed/json

You can add me now, dude!

It pays to be curious

Zoom expired my password and forced me to change it, something about a third party being compromised. I generated a new one on my password manager and, lo, it didn’t allow me to paste it. Zoom wanted me to type by hand my new long, random password.

I had an immediate solution: sleep 1s; xdotool type $(xclip -o -sel c). There. Password typed.

It’s one of those moments where it pays to be curious and keep learning stuff, even if you think it’s too niche. It might come handy when you least expect it.

Moving lines in Vim

I’m learning to move ranges of lines in Vim. What I usually did was jump to the starting line, enter Visual Mode, select the lines I want to move, cut, move to the desired location and finally paste.

But Vim has a more efficient, shorter and faster way to do this, no cursor moving at all.

  • Move current line to line after 12: :m 12
  • Move current line to before first line :m 0
  • Move current line to after last tine :m $
  • Move current line to after line with mark a: :m 'a
  • Move range of lines: 5,7m 21 — will move lines 5-7 to after line 21.
  • Move 5 lines starting at current line to after line 21: :.,.+4m 21
  • Move current line 2 lines after current line: :m .+2

And you can return to the line you were with g; (and g, is the opposite).

Looking for a better Wiki

Three years ago, I tried VimWiki but it didn’t convince me. Markdown is not a first-class citizen, but VimWiki’s own syntax. It also uses its own filetype, which made me lose my Markdown customizations. HTML export is only for VimWiki’s syntax, not Markdown. It also stole the Tab mapping I use with UltiSnips.

Then I found Wiki.vim and everything is great. It’s not a filetype plugin, so I can keep my Markdown filetype. It doesn’t overwrite my mappings. It uses Pandoc for export, which is great. It has FZF integration. It has tags, not sure if VimWiki have them too, and I haven’t tried them yet.

I still use it, three years later and now I want to improve some things.

I’ve reached Todoist’s Enlightened Level

I usually don’t celebrate these gamification things, but hey, my days have been hectic and stressful lately, so yeah, I’ll celebrate this one.

«Enlightened» level is Todoist’s highest level when reaching 50,000 points; I guess I won at Todoist, then? Oh, no, wait, the help page says:

Once you reach Karma Enlightenment, a new mystery theme will be unlocked on your account.

Ok, that sounds interesting. I see nothing new on my account, maybe it will roll out soon.

Update: Sorry, I misread. It’s a mystery theme, not a mystery level. Yeah, I can see the new color theme now, pretty fancy. And so, yes, I totally won at Todoist.

Todoist, by the way, is the task list management service I currently use, after Wunderlist begun its slow death. As my Karma level can attest, I highly recommend it.

Lock screen triggering twice on Xubuntu

After upgrading Jupiter’s Xubuntu to 22.04 (Jammy Jellyfish) on the holidays, I had this weird bug with XFCE where you unlocked and right away you got a different lock screen again, but the text boxes didn’t work and it didn’t respond to mouse clicks or anything. And it’s super hard to search for that kind of thing.

Long story short, disable XFCE’s Screensaver. That second lock screen comes from the screen saver, yep. Why does this happen is beyond me. And since we don’t use a screen saver on Jupiter (it’s the family machine), and I had other things to fix and adjust after the upgrade, I’m OK with this solution.

Back to school

Kids are back to school. All morning routine and habits are currently broken, as expected.

Kids were excited and eager to return to school, which is a good thing.

The Lord has provided and we’ve covered the additional expenses.

Dabbling with Python again

My relationship with Python is a coming-and-going one. I was recently chatting with Oliver and he asked me what I didn’t like of Python and I said the answer was subjective, but didn’t have an otherwise straight, concise, informed answer. It’s more about feeling, actually. I want to have a better answer.

I currently prefer Ruby to Python, but I want to like Python. I’m not interested on finding out which one is better or picking a winner, I want to be fluent on both languages and use whichever does the best job for the task. I wouldn’t rewrite my Ruby xdotool wrapper in Python, for example. And I wouldn’t rewrite my code generator written in PHP because PHP is something Python and Ruby are not: a templating language. Best tool for the job.

While I can do (and have done) stuff with Python, I don’t consider myself a good Python programmer. There’s lots of gaps in my knowledge. I don’t feel comfortable with it. There goes that feel thing again, dargh. Whatever, I just want to learn Python properly.

I rewrote my latest Ruby script to Python, it automates getting the day’s Zoom invitation for sending it to my church’s WhatsApp group. Surely there’s better, pythonic ways of doing things, but it works and it gave me a better understanding on how to do things in Python based on how I usually write them in Ruby.

And I learnt about assignment expressions. I didn’t know Python couldn’t do that and I’m glad they added them to the language already. The reason behind them was exactly what I stumbled with: having a condition where a regular expression matches and needing the match object assigned to a variable. I was like, «why can’t I assign in a condition?»