Microblog Entries

Brief thoughts, updates, and commentary

24 February 2021

Modernized my Bookshelf with HTMx

I’ve always been a huge fan of htmx  for it’s straightforward empowerment of the HTML specification. For those who may not know, htmx allows you to “access AJAX, CSS Transitions, WebSockets and Server Sent Events directly in HTML, using attributes, so you can build modern user interfaces with the simplicity and power of hypertext”.

I never got around to finding a good use case for htmx in a personal capacity, but recently I wanted to revamp my Bookshelf page; which was initially built using a combination of Tabs and Modals (as afforded by Bootstrap) in order to group book covers and display their summaries.

It wasn’t a bad setup, however in my opinion it wasn’t very elegant because the content of the inactive tabs would also load within the page itself, even though they were hidden. This resulted in a larger request size since all the cover images would be included.

There were obvious scaling issues that would appear as the number of books increased. I needed to refactor the landing page with that in mind, whilst keeping the other pages for each title range separate — so that they could be swapped into the DOM intelligently and in keeping with the tabbed concept.

Immediately htmx came to mind, and it’s so simple to use that I implemented the fix in less than 10 minutes. Each alphabetical title range now resides on it’s own page (five in total), and Jekyll populates the content within them from the .yml data files at build time as it normally would.

The main difference is that now the Bookshelf landing page only displays the first set of titles; with the content from the other pages loaded only when they are requested. All this is done without leaving the existing URL, as the innerHTML of the parent container is the only element that’s interacted with.

The result is that the Bookshelf page went from ~150 lines of HTML to ~30 lines of HTML, and only the number of images for the first of five categories are initially loaded, versus all of the images being loaded in the previous iteration.

It’s a lovely way for me to implement the desired functionality and also pay homage to htmx which in my opinion represents what the KISS  methodology is all about. While not forgetting to mention its distant cousin Turbolinks , htmx is one of the greatest innovations in Frontend Development to-date.

I shall gracefully steal their haiku and place it here for extra style points:

javascript fatigue:

longing for a hypertext

already in hand



18 February 2021

ownCloud + Amazon S3

I have a private ownCloud server that currently stores its data in the default /var/www/owncloud/data directory, which ordinarily takes up storage space on the server filesystem itself.

Thankfully, ownCloud supports connecting to external storage services in order to extend the amount of space available to the user. In my case, I used Amazon S3  buckets — which offer cost-effective and reliable object storage — as targets that ownCloud was able to connect to and mount as directories within the application and file system itself. This a great option for storing data that needs to scale in a quasi-archival manner versus warmer (hot) data that’s updated and synced daily.

Best of all, buckets can be added and removed without issue (read: unmounted and mounted), which means that they are entirely portable if I decide to change hosting providers for my ownCloud server itself. This should also work for anyone who uses NextCloud, as it’s a fork of ownCloud and thus the integrations are similar.

One interesting tidbit is that ownCloud’s spanking new release is called Infinite Scale  and will actually reach production-ready status when the versioning hits 2.0.0. It uses a single Go binary for deployment vs. the current LAMP stack, and from the results of my testing I can confirm that it’s mind-blowingly fast.



15 February 2021

Are we Living in a Simulation?

I’ve seen this discussion pop up from time to time in social media and on podcasts, and it’s an interesting thought experiment to consider whether or not we’re living in a simulation; but I fervently believe that we do not.

Nature is fractal yes, but we tend not to be. If we assume or postulate that the universe is a simulation, then that seems akin to conceding that nature is designed by an invisible hand or higher order; much like theology does insofar as they believe in a “Prime Mover” or generic sentient being.

There is also the meta-question of free will, or why humans, highly-evolved primates with a frontal lobe, would seek to explore our way out of a simulation rather than try to verify if such a simulation exists in the first place. This comes down to scientific modelling vs. scientific experiment, and I think the latter has been sorely abandoned by those who suggest that the existence of a simulation might be real.

The line of thinking I’ve come across in support of simulation theory boils down to this: we describe the world and it’s boundaries only with the tools that we have, and in the dimensions that we can inhabit. We have invented the tools themselves with which to explore the universe and reality, from the cosmic level to the quantum level, and beyond each of these limits exists both complexity and unknowns that suggest a thinning of the veil.

I think such an argument for simulation theory again alludes to a larger superintelligence (if such a conjecture is extrapolated), and belies something almost eschatonic in nature (having a finite, true end). In my humble opinion, such a fated, procedural, and linear system is at odds with the concept of free will.

To believe reality is a simulation would mean conceding that all externalities and unknowns are "glitches in the Matrix" or otherwise imprints from outside of the simulation. Emergent properties? Glitch. Creativity? Glitch.

We are not machines, and this is not a reality that can joined at the hip to a singular dimension in order to prove that a simulation is in progress (the dimension being time, in the linear sense).

I think while not improbable, it is more importantly indefensible inasmuch as it is an affront to our intelligence to suggest that our historical record, our morals, our very choices themselves are predetermined or parameterized in any given way.

It might be fun for science fiction (I’m reminded of Marvel Comic’s The Beyonders), but in my opinion it’s bordering on misanthropy to think that a simulation is in charge of all of us, let alone that the creators of such a simulation have a hand in shaping the Universe, and life itself.



Copyright © Paramdeo Singh. Built with Jekyll and ❤ in Guyana. All Rights Reserved.

Last Site Build on Fri, 26 Feb 2021 11:52:37 -0400