Projects¶
Starting documentation of mini-projects, to justify disappearing time.
2021-02-25 Server-side code¶
Apparently PHP files can also be served as HTML, with additional
processing of <?php ... ?> tags inside the HTML. Very handy!
Some possible starting points:
Managed to add PHP scripts to the Sphinx documentation as well, by
relying on templating and changing the html_suffix to .php.
2021-02-25 GitHub Action to alert Telegram group of new PR¶
Because no one has the habit of checking email as frequently as we do Telegram groups, our requests for PR reviews are manually channeled to our Telegram group. Not anymore!
My proud work spanning two hours or so, to familiarize with GitHub Actions and Secrets. Prior knowledge of setting up a Telegram bot helped speed up the process.
2021-01-23 Website loading optimization¶
Was browsing through list of domains, when I chanced upon Google’s PageSpeed Insights, and the slow responsiveness of the website shocked me.
The main culprit turned out to be some Javascript served by the embedded Youtube video immediately on pageload, which can be deferred by utilizing some lazy loading techniques. This advice was a good one that I pretty much copied wholesale. This chopped off around 2 seconds of resource load and JS execution time.
But apparently this isn’t good enough:
Some other strategies used include shrinking the profile picture,
preloading CSS instead of inside the main CSS @import "canvas-con.css";,
to finally push the rating up into the green zone.
The main differences as follows. I guess there’s still a long journey ahead when it comes to web optimization… Still haven’t really dabbled into modifying the cache TTL for images on Apache.
The overall performance on desktop is not as significant though, but my best guess is the multiprocessing capabilities of desktop browsers as opposed to mobile ones.
2021-01-22 Scraping CS2103 website¶
‘nuff said: https://gist.github.com/pyuxiang/ab547e824c5c1f5f8b8ea3e8690e090e
This module has in-video quizzes, which are marked by tiny yellow boxes. Figured I write a quick script to immediately link to each video, and parse the output in Markdown so that it’s compatible with GitHub Issues.
Suspecting most of the other students come from C++ background instead of Python, so I threw in an extra automated library downloading function. Now to find the different OSes to test my scripts on…
2021-01-18 Mini schedule¶
On TODO page. ‘nuff said.
2021-01-17 Gym records¶
More of a two part, the first of which is to have a feel of the crowd at the Canberra Gymmboxx gym. The website itself has a page showing the crowd level at each respective gym, but was in fact regularly querying their backend API every minute. So I can simply masquerade by doing the same.
Since this is going to be a roughly long term project to track the gym trend, I’ve set up a cron job on my server to do this query. There are seven gyms, so to mitigate the large file size, I split them into weekly logs (noting that the API serves time in UTC format… why…?). Enables live plotting using Javascript, but I’m a little busy with other stuff to work on this for now.
Thing is, it’s a little troublesome to manually track gym attendance. Would want to create a mini GUI for this (since it’s also for another non-technical user), but why reinvent the wheel when Google Forms does the job fast? Pulling data directly from the linked spreadsheet and plotting it using matplotlib. I really should pick up GNUplot for this, since I can’t get my Linux environment to compile matplotlib.
Also my weight lifting sucks, but why do you care :>
Update: Turns out the gym itself has horrific reception, so I can’t even access the internet. Make sure to properly do requirements before embarking!
2021-01-16 Google Sheets Timeline¶
Wrote mini script to automatically format time blocks on a Google Sheets time tracker.
I actually already have one on Excel, with many more macros written in VBA script.
Issue is when working on multiple computers, changes tend to go out-of-sync since they depend on the sync queue of Dropbox. A method to update this on a phone would be even better, hence offloading to Sheets.
Most of the time comes from identifying time blocks + merging and assigning colours based on the productivity of the session. Figured I automate this as well.