Skip to main content

Posts

Showing posts from February, 2025

Legion

Hello. 👋 I do own a Legion laptop from Lenovo. Not free though. Aside from the quirk of Lenovo and Ryzen (AMD) processor , I then realised. 🤔 That popularised term in horror — supernatural trope, was indeed taken from the Bible, was it not? These excerpts: Mark 5:1-20 Matthew 8:28–34 Luke 8:26-39 I put Mark 5:1-20 as the first in order because the story there is more vivid compared to the other versions. As far as I know, this recorded event is actually the only event Jesus negotiated with the malevolent entity. The Decision Making They were in order of thousands, a military legion usually consists of ±5,000 soldiers. I first thought those lost spectres functioned as a single collective hive mind, like Cherubim. But then in the story, they begged to be sent into those 2,000 pigs. Meaning each of them had free will perhaps and surely can separately occupy one pig. — Woo, piggy ride! But they did have a spokesdemon: ...

CSS: Aspect Ratio

Background Prior to 2021, I accomplished it through JavaScript, using getComputedStyle combined with window resize event listener to (re)define the height of an iframe . But now, we have aspect-ratio . Hm... Be gone all that hassle! 🪄✨ Here's how we sort it with CSS. Example Implementation For example, we want to make the embedded iframe from YouTube to be responsive — having 100% (or other percentage) of width of the container and let the height automatically follows the ratio. We shall use 16:9 ratio for this example. The YouTube embed code is usually as such: We can omit the height , width , and frameborder from that, then add class for the iframe . Let's use YT_EMBED as the class of the iframe . For clarity, I'll make the attributes to have new lines: Then we define the CSS rules for the .YT_EMBED . Put all together, it will look like this: That'll do it. It will automatically be in 16:9 ratio. Quite. D...

YouTube: New Cinematic Experience

This was from my music listening experience. I was listening Blue playlist, and "Best In Me" popped in. Oh! What a brilliant refrain — my reaction was. I then actually watched the video. 👀 And — Hm, wait a minute, what happened to YouTube video layout? 🤔 Why there's no black bars on top and below the video? The music video is actually beyond 2.39 : 1 ratio ( 21 : 9 ) — around 2.54 : 1 . I saw it: WHOA Quite. I guess it's YouTube's new feature. ChatGPT's remark: At this rate, YouTube will soon introduce a 360-degree wraparound screen—because why stop at just ultra-wide? I'm staying out. And speaking of "staying out", here's a song from Paul Gilbert: And this is the Blue's video, using 2.54 : 1 aspect ratio:

JavaScript: Sleep Function

We sometimes need a thing to delay the execution of the next function. There is no built-in method to do that. But, it is possible by implementing both Promise and setTimeout . In prior times, we only had setTimeout , or combined using setInterval . That worked. But now, we have Promise . So let's use it. Create the Function Let's name our function as sleep . /** * Delays execution for a specified duration. * * This function returns a Promise * that resolves after the given number of milliseconds. * It can be used to introduce asynchronous delays * in JavaScript code. * * @param {number} ms - The duration of the delay * in milliseconds. * @returns {Promise<void>} A Promise that resolves * after the specified time. * */ function sleep(ms) { return new Promise(function (resolve) { setTimeout(resolve, ms); }); } Or we can compact that using arrow expression, as such: const sleep = (ms) => (new Promise((resolve) => ...

Blogger Template Formatting: The Secret to Perfect Indentation

Have you been wondering how to make your Blogger XML easy on your eyes and your blood pressure? I bet you have. But since nobody talks about this (maybe), then I shall talk about this 🫡 5,000+ lines of code is not something to take lightly. We need consistent indentation to clearly see where each tag begins and ends. This Is An Example THREE MAGIC STEPS We select everything on the XML template. Hit: CTRL + A Put some "fake" indentation by pressing TAB Finally, hit: SHIFT + TAB Afterward, we can save that. This auto indentation feature also works in post edit/create! Actually, we do not need to make the "fake" indentation, that was just me doing it because I am used to VS Code (Visual Studio Code) . So then it is just two magical steps: Select : highlight some parts or select all using CTRL + A . Tidy it up SHIFT + TAB Anyway,...

Alphabet

I was curious about our writing letter system, the Latin script. It consists of A through Z. The system has no Alpha or Beta. Alpha (α or A) and Beta (β or B) are within Greek script. And the most baffling is the writing direction, Abjad has it right, pun intended. They start from right to left, that is natural for any right-handed person to write like that, am I right? Or, in Logographic system (Kanji, Kana, Hanja — Chinese, Japanese, Korean) has it from top to bottom AND RIGHT TO LEFT (back in those days) — it's natural. Left to right feels awkward at time. I was a left-handed child, but then time made me a right-handed man. You know, tradition. It goes something like this: Phoenician system (~1050 BC) The Original Gangster of many writing systems. It was the origin of Abjad, only consonants, no vowels. The writing direction was right to left like a SANE person would do. Well, at least a sane right-handed person chiselling the stone. Ancient ...

Blogger AND Operator

I was skimming through this theme template XML , and I noticed there was the and being used inside the condition of b tag. The last image above, you can see even OR operator is written conveniently as or ! Perhaps that is not new to some of you, but to me, that is NEW! 😄 I do actually implement that to my own logic in the Blogger XML template. But of course, it again depends on the logic. We can do this: if (condition_1) { if (condition_2) { // condition_1 AND condition_2 are satisfied } else { // Only condition_1 (outer) is satisfied } } else { // None of the condition } Or this: if (condition_1 && condition_2) { // condition_1 AND condition_2 are satisfied } else { // None of the condition } Example I mostly implement the second one. So, it's quite convenient to write it like regular coding syntax. For instance, this nesting: <b:if cond='data:blog.pageType == "item"'> ...

Chess: Caro-Kann Defense With Awkward Mid-Game

I was playing offence (white piece), and started it with the famous e4 , woohoo 👯‍♀️ At fourth banter, my opponent did adventurous move there with f5 response after my e5 peon move. Then, awkward piece placements happened. Unfortunately for my oppenent, I ended up having way better position after I did I don't care moves 🤣. The part where, oh my horse on g5 is pinned, ah well, whatever, mate. Take it. Then... clink clank clunk 😕 You can use your left and right arrows on your keyboard or use the mouse scroll to see the moves back and forth on the chessboard. But first, click the board.
Monkey Raptor uses cookies for analytics, advertisements, and functionality. More info on Privacy Policy