Skip to main content

Posts

Oedema

Recent posts

JavaScript: Recursively Retrieve All Nested DOM Elements (Snippet)

Hi. 🙂 Let's name the function as crawlElements . /** * Recursively collects all nested element nodes from * a given DOM node. * * @param {Node} node - The root DOM node from which * to begin the search. * @returns {Element[]} An array of all descendant * element nodes found beneath * the input node. * * @example * const root = document.getElementById("container"); * const allElements = crawlElements(root); * console.log(allElements); // Array of nested div, span, etc. */ function crawlElements(node) { let elements = []; const isElement = node && node instanceof Element; const hasChildren = isElement && node.hasChildNodes(); if (!hasChildren) return elements; node.childNodes.forEach((child) => { if (child.nodeType === Node.ELEMENT_NODE) { elements.push(child); elements = [...elements, ...crawlElements(child)]; ...

World Domination: The Villain's Handbook (Skeletor)

After watching He-Man for more than 10 episodes, I sensed something awkward. 🤔 Skeletor with his might and schemes, as a fulltime villain, could not defeat He-Man, the freelance superhero — an unbeatable response squad. The less-clothed, tan, deeper and reverb-enhanced voice Prince Adam — is an instant comedy. And! When we apply that to a real life situation, lifting a sword, shouting, becomes almost nude, then doing his duty as He-Man, is... unfathomably brilliant. Did you notice "he" is a pronoun used to refer to a male? Also, "man". So many gems. Let us see from the overall perspective. Suppose Skeletor won and ruled Eternia. He has little-known management and political skills — he has skills, but certainly not those. Therefore, after Skeletor sits on the throne for 1 full day, we should expect chaos and gradual destruction of Eternia. Imagine: Evil-Lyn : ...

Music: Amazing Grace

Please Enable JavaScript. One verse of Amazing Grace on electric piano. To echo John Newton. 4 August 1725 – 21 December 1807 A quiet rendition by Jp performed through Cakewalk . The rendition above is performed in the key of A — A Major scale (three sharps scale, do = A). Amazing Grace is commonly performed in G Major scale (one sharp scale, do = G). Audio is licensed under CC0 (Public Domain — no restriction) . About Amazing Grace 📜 John Newton wrote the lyrics (hymn). It wasn't metaphor — it was fact. He wrote his hymns in 1772 — after his soul heard and felt, Hey . First published in February 1779 as Olney Hymns — curated work of John Newton and his poet friend, William Cowper (1731–1800). Page 53 in Olney Hymns, the verses that would become known as "Amazing Grace". Amazing Grace lyrics is taken from Hymn XLI (41) verses — page 53 and 54 — of Olney Hymns. Olney is a historic market town in...

CSS: Using Invalid and Valid Pseudo-Class

The title is ambiguous actually, why do we want to use an invalid pseudo-class? 🤔 And is it not valid pseudo-class in CSS plenty? Why? Because. Hi. In form context, we can use :invalid and :valid pseudo-class to notify user if their input is either invalid or valid. The CSS styling for the pseudo-class can be applied to: input tag (with exception) ✅ ❌ Input type exception: button , submit , reset , image , hidden , file , range , color , checkbox , radio . It is because there is no validation is done to those particular types. textarea tag ✅ select tag ✅ Let's try it combined with massive JavaScript and plenty of HTML elements. 🤣 No, it's quite straightforward actually. We can see the example below. Demonstration Please enable JavaScript Please choose Option One Option two Option three Option four ...

Chess: Drunk Bard Zukertort Opening: Tennison Gambit

I played offence (white piece) — in 3 minutes Super Blitz game as Anonymous on Lichess employing drunken Tennison Gambit . The tipsy placements after the Tennison Gambit bit were indeed wild. Expectedly, I did plenty of blunders as the offence side. But! Checkmated my opponent at 33rd banter. 💥 🤣 Hats off to the defence side — for being generous obviously — as I wore no hat to begin with. The defence side was quite baffled I assume, by the way the online indicator stayed green for more than 3 seconds after the checkmate. I did not laugh, composed(ly holding it together) — I did smile a bit after the online indicator turned gray. The speculative opening combined with the speculative tipsiness were indeed both confusing. Hence... Be my guest. 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. That game was clearly chaotic. Thus, it is...

Suck

Suck The original meaning is "to draw in air or liquid through the mouth". The word suck stems from Old English (Anglo-Saxon) sūcan . It was Germanic to its very bones — more in common with Old High German and Old Norse. Anglo-Saxon sentence examples: Sē cyning wæs swīðe gōd . It means the king is very good . Sē cild sūcþ meolc of þǣre mōdor brēoste . It means the child sucks milk from the mother's breast . Indeed with the accent for the vowels, confused Greek letter, and the mashed together alphabet 🤷 Romans talked like that (alphabet discipline), non-Romans talked with diverged flavours and lisps. Thus, the party. 🎊🎉🪅👯💃🐐🐔🐄🥳 The extravagant (confusing-cough) writing was developed later on — Latin literacy first brought via the Christian Church. Then, the party. Most notably, St Augustine of Canterbury , arrived from Rome. "St" is Santo (masculine) or Saint in English. It does not mean that person suddenly ...
Monkey Raptor uses cookies or biscuits 🍪 for analytics, functionality, and advertisements. More info in Privacy Policy