The GLib.timeout_add function is the GJS equivalent to both setTimeout
and setInterval
. It calls a given function repeatedly (such as func
) at given intervals until it returns a falsy value. It returns a GLib Source id, which just like clearTimeout
or clearInterval
can be removed with the static GLib …
[ ...articles ]
-
-
batch renaming numbered files
The year is 2009 and your minimalist CD ripper, let's say
goobox
hasn't multi-CD support. The ripped content of both CD 1 & 2 are numbered incrementally from01
onwards, which isn't a problem if you organised your library by CD 1/2/etc, but you're rather flatten the directory because … -
generating video thumbnails in js
HTMLCanvasElements are amazing for all kinds of things. Paired with the CanvasRenderingContext2D's drawImage method, generating video thumbnails on browsers are incredibly easy. The interface for the method is as follows:
void ctx.drawImage(image, dx, dy); void ctx.drawImage(image, dx, dy, dWidth, dHeight); void ctx.drawImage(image …
-
how i created a trigger warnings modal, and removed it for accessibility
When I first had my coming out story reviewed by some queer peers, the initial feedback I received was that it required "trigger warnings" because it covered some pretty heavy topics.
My initial solution was simple;- add a row to the post information section highlighting the various trigger warnings in …
-
on taking a break
It is almost poetic justice that the last time I wrote was on Labour Day, 2019. Not long thereafter, I went on a slurry of vacations from Bangkok for 2 bachelor parties, Georgia for a wedding, a multitude of places for Europe, finally ending my streak by attending the Pride …
-
the error paradigm
The error programming paradigm comes from the recognition that errors are expected. Consider a function that is meant to parse JSON data. Naturally should the input string not be of valid JSON format, the function would error out. That is because handling invalid JSON data is out of the scope …
-
Default Title
The use of default values, also known as optional parameters is a controversial topic in programming. Languages like Go even go so far to outright disallow the possibility of using optional parameters or method overloading, emphasising simplicity instead. But what exactly are optional parameters used for?
The Wikipedia page for …
-
the unix paradigm
If you're a learned programmer or computer nerd, you may have heard of the UNIX philosophy;- A set of guidelines to developing minimalist and modular software. The premise of this design pattern was fundamentally opposed to software designed in a monolithic fashion. We've all seen those crazy bash liners for …
-
identifying a hack
I was one rainy evening on the way to town when I noticed that my Grab driver was sitting in a very strange position. I asked the man had they any spine condition or something of sort, and they replied no. Helpfully they added that they were leaning to the …
-
saluton
This blog has been a long time coming, having been pestered many times by friends & colleagues.
I was intrigued by a Kazakh colleague of mine learning that in Russian, the phrase "do not reinvent the wheel" basically is literally "do not reinvent the bicycle". I naturally found that cruelly ironic …
« page 2 / 2