Today I Learned - Rocky Kev

All Posts

  1. TIL what is npm Script

    Despite their high usage they are not particularly well optimized and add about 400ms of overhead. In this article we were able to bring that down to ~22ms.

  2. TIL Netflix's System Design

    Netflix operates in two clouds: Everything that happens after you hit play is handled by Open Connect. Open Connect stores Netflix video in different locations throughout the world. Anything that doesn’t involve serving video is handled in AWS.

  3. TIL the Waluigi Effect in LLMs

    The Waluigi Effect: After you train an LLM to satisfy a desirable property 'P', then it's easier to elicit the chatbot into satisfying the exact opposite of property 'P'.

  4. TIL using the find command

    find [path] -user [username] [options]

  5. TIL defining your video game in hooks

    I like to think of a game’s potential in terms of 'hooks.' By this, I’m referring to the inherent momentum within a title to hook a buyer. I was just looking at the data on Steam, and there were 10,963 new game titles released in 2022. My strong suspicion is that most of them never generated a dime in revenue. Without some hook for your game, no one will ever play it, much less buy it.

  6. TIL fancy methods to transform Javascript Objects

    You can use Object.entries(), Object.keys(), Object.fromEntries()...

  7. TIL how to hide your JS code

    ONE THING TO NOTE: Encrypting a script is stronger than obfuscation, both methods are still not adequate to protect secret content. Honestly, I don't think it's worth it on a production site, and instead just go with pure server-side if you want security. But it's fascinating.

  8. TIL how build tools work

    There's 4 steps. Compiling -> Minifying -> Bundling -> Code-splitting

  9. TIL how to build a chrome extension that steals everything

    There's 3 components that will be used - background Service worker, Content script, and popup.

  10. TIL minimal responsive image component

    So when I saw that JS frameworks made image wrapper components (like Nuxt was with nuxt-img), I was blown away and wanted this power at work.

  11. TIL executing a xss using a SVG image

    This user was able to upload a '.svg', that then executed a xss attack to steal local storage data.

  12. TIL How to steal localData using an XSS attack

    But that's just a red flag that opens the door to bigger issues.

  13. TIL Dwarf Fortress Game Design

    'Do not design for your experienced players' and some more tips from one of the most complicated games ever

  14. TIL the alternate keyword

    If 'alternate' appears along with the stylesheet keyword, the linked file is an alternative stylesheet. It won’t be applied to the document, but it will be ready for when we need it.

  15. TIL Clear-Site-Data

    The Clear-Site-Data header clears browsing data (cookies, storage, cache) associated with the requesting website. It allows web developers to have more control over the data stored by a client browser for their origins.

  16. TIL not obsessively trying to be DRY

    Quite often, DRY is applied to any duplication, rather than specifically to the duplication of business rules and knowledge. This is often made worse by automated code analysis tools, which will often highlight any duplication as a code smell.

  17. TIL the cost of spaces on TypeScript compile

    One nice surprise we found from using esbuild was that on-disk size was reduced by more than we expected. It turns out that a big reason for this is that esbuild uses 2 spaces for indentation in output instead of the 4 spaces that TypeScript uses. When gzipping, the difference is very small; but on disk, we saved a considerable amount.

  18. TIL a bunch of new functional programming words

    It's so funny seeing developers re-invent functional programming paradigms. We really need to teach this stuff better.

  19. TIL Indirection and Swallowing the error

    Op shared a tryCatch util that is problematic.

  20. TIL Why is TextEncoder a class

    My assumed answer - it was for extension. What does reddit commenters have to say about it?

  21. TIL Logical Properties

    For that sweet sweet Internationalization you want to avoid directional words like 'left', 'right', 'top', and 'bottom'.

  22. TIL Evil code

    These examples are unethical, and can even be criminal. You can get jailtime. You have been warned and I cannot be held liable for your dumb-assery.

  23. TIL Static Blocks vs Dynamic Blocks

    A static block is a piece of content whose markup is known when the page is saved. The block saves its content and markup directly in the post content. A dynamic block is a piece of content whose markup and exact content are not known when the page is saved.

  24. TIL how to convert a shortcode to a WP block

    Traditionally, shortcodes were a way that plugin developers could provide users the ability to add specific plugin functionality anwhere on their site. But shortcodes are not very user friendly, nor was hunting down the relevant data you needed to render the correct data for the shortcode. Converting existing shortcodes to blocks provides a much greater user experience in all aspects.

  25. TIL Play music in a bash script

    On Macs, you have the afplay command. to play some sweet tunes.

  26. TIL Google Sheets has named functions

    It's a way for you to make functions using built-in formulas.

  27. TIL how to JUICE up your UI

    The delightful chimes sound that plays when Mario collects a mushroom. The 1UP text that appears is essential. Communicating the player gained an extra life. The sound is the Juice.

  28. TIL why google recommends you avoid document.write()

    By injecting it with code, it bypasses the preload scanner. This means that the browser can’t request this file until it’s actually run the '<script>' block that inserts it, which is very much just-in-time (and too late).

  29. TIL Using pseudo-classes in your querySelector!

    let notTuna = document.querySelectorAll('.sandwich:not(.tuna)')

  30. TIL using abortController to removing events

    Trying to unhook a eventListener? Don't use `removeEventListener`, instead use AbortController.

  31. TIL detecting if a user is online with JS

    You can use the navigator.onLine api.

  32. TIL prioritizing Javascript

    ... async and defer attributes should be used where possible to avoid render blocking of the DOM. Render blocking is when the browser must halt all rendering of the page in order to process a resource that the page depends on.

  33. TIL problem with AJAX

    Synchronous XHR is harmful for performance because the event loop and main thread is blocked until the request is finished, resulting in the page hanging until the data becomes available. fetch is a much more effective and efficient alternative with a simpler API, and has no support for synchronous fetching of data.

  34. TIL why jpeg vs jpg

    In DOS systems, a filename extension was a different part of the name stored in a different field that can only be 3 characters. You still see this legacy today in Microsoft's .NET software, where most system calls that use the word 'filename' in their name don't really mean the whole filename. They mean just the part without the extension.

  35. TIL Container Queries are live!

    After @container, elements can respond to a parent container size or style! The only caveat is the containers must declare themselves as possible query targets, which is a small requirement for a large benefit.

  36. TIL the history of fonts and COLRv1

    COLRv1 fonts, have a smaller footprint, vector-scalable, reposition-able, gradient-featuring, and blend-mode powered fonts that accept parameters to customize the font per use case or to match a brand.

  37. TIL ":has" selector

    Before :has(), the subject of a selector was always at the end. Like 'ul > li:hover' or 'ul > li:not(.selected)'. Now we can do ul:has(> li)

  38. TIL Harmful language

    We’ve talked before, we’ve used that phrase “words matter” because words matter, words are the way we communicate with one another, it is how we perceive our self value in our own head.

  39. TIL ways to organize eventListeners

    Some code spaghetti I made recently was creating a lot of eventListeners for multiple buttons, and then forgot what they all connected to.

  40. TIL a helper to make things uppercase

    ucWords function converts the first character of each word in a string to uppercase. This function is the same as PHP’s ucWords function.

  41. TIL the core-js spam trolling

    This entire repo is a hilarious rabbit-hole when you combine this with everyone complaining about the console spam that the dev added to it asking if anyone can find him a job. One of my favorite PRs

  42. TIL how Error correction works in HTML

    You never get an 'Invalid Syntax' error on an HTML page. Browsers fix any invalid content and go on.

  43. TIL Legend of Zelda course corrects movement

    If you play The Legend of Zelda for a while, you’ll notice that Link doesn’t ever get hung up on obstacles due to unexpected collisions, nor do you ever just miss a bad guy by a pixel or two when attacking him.

  44. TIL what DOCTYPE means

    tl;dr: DOCTYPE declaration in the first line of the HTML file, to instruct the browser to run the code in Standard mode.

  45. TIL how Levels.fyi used Google Sheets

    Our philosophy to scaling is simple, avoid premature optimization.

  46. TIL How many Fucks there are in Linux

    As of today, in the Linux Repo, there are comments that contains the following mentions: 1,651 for hacks, 2,863 for workarounds, and 4,102 for fixme

  47. TIL Dirty bit systems in browsers

    In order not to do a full layout for every small change, browsers use a 'dirty bit' system. A renderer that is changed or added marks itself and its children as 'dirty': needing layout. There are two flags: 'dirty', and 'children are dirty' which means that although the renderer itself may be OK, it has at least one child that needs a layout.

  48. TIL individual transform CSS

    We now have individual transform CSS!

  49. TIL Web Performance with Javascript

    Overall, we should be loading the most important JS first to get the website working. Then load all your third-party scripts onto your web worker, which then responds with 'Success' once it loads, so you can then interact with it.

  50. TIL how QR codes work

    The Quick Response code was invented by a subsidiary of Toyota to track parts across the manufacturing process.

  51. TIL Shape-Outside to wrap text

    Shape-outside provides a way to customize this wrapping, making it possible to wrap text around complex objects rather than simple boxes.

  52. TIL keywords in package.json

    Today I learned what keywords are in a package.json file! It's a collection of keywords about a module. Keywords can help identify a package, related modules and software, and concepts.

  53. TIL Tagged Templates

    Tags allow you to parse template literals with a function. The first argument of a tag function contains an array of string values. The remaining arguments are related to the expressions.

  54. TIL Find Command

    I wanted to look for files with a specific extension. You can do that with ls *.(mp3|exe|mp4)

  55. TIL Multiple Fetch Requests

    I've been frequently dealing with this scenario in the past few weeks. I wanted to make multiple fetch requests, and then merge everything together when it's all done. To make multiple/parallel fetch requests:

  56. TIL Forever Seinfeld

    Nothing, Forever is a parody of '90s sitcoms, done in the style of '90s point-and-click PC games (but, you know, in 3D). We set out to build something weird, new, and novel, and this is what we ended up with.

  57. TIL wanting to use the latest thing

    In evaluating a solution, be sure to consider the library dying out or becoming a maintenance burden after 5 years (e.g., everyone trying to get off jQuery onto Web Components).

  58. TIL why you should always use textContent

    Today I learned the difference between 'Node.textContent'. It handles all elements, even hidden ones. It also prevents XSS attacks since it strips tags.

  59. TIL critical 14kb

    On the OSI Model -- the physical layer, we send data in 14kb packets. And servers respond to HTTP requests in 14kb chunks. (Note: It can be set to different sizes, but by default... 14kb is the standard/magic number)

  60. TIL no global styles

    Global styles is the largest **anti-pattern** in CSS --- strong DISAGREE.

  61. TIL types of malicious npm attacks

    In the case of ionicons, the miscreants published 18 versions containing malicious form-stealing code; for example, icon-package (according to NPM download stats) has over 17,000 downloads. Other typo-squatting examples include umbrellaks instead of umbrellajs and so on.

  62. TIL malware in node_modules

    The very first line fetches the victim's country code using their IP address. If the victim is from Russia, Ukraine, Belarus, or Kazakhstan, then the malware exits early.

  63. TIL Infinite State Machines in Doom

    The actual core logic of the enemies is a Finite State Machines: a simple but effective mechanism to state that a character executes a specific behaviour when in a given state, and what the conditions are that will force it to change.

  64. TIL Land in Virtual Games

    in [Star Wars] Galaxies … there was ample room for everyone to own a house if they chose – but people did things like build player cities atop the entrances to dungeons to monopolize access to resources.

  65. TIL Scoping with Cypress

    So you wanted to find a specific element called `heading`. But you have a BUNCH of elements called `heading`. By using `within()` helper, you can force it to only look inside `main` elements.

  66. TIL the first webcam

    The Trojan Room coffee pot was a coffee machine located in the Computer Laboratory of the University of Cambridge, England. Created in 1991 by Quentin Stafford-Fraser and Paul Jardetzky, it was migrated from their laboratory network to the web in 1993 becoming the world's first webcam.

  67. TIL SolidJS reactivity

    SolidJS is a JavaScript framework that supports binding data to elements that it then syncs and displays on web pages.

  68. TIL a mod dedicated to his fiance

    The best way to avoid DVT is simple: Save your game, stand up, and walk around for 2-3 minutes every 3 or 4 hours. Go to the fridge, pee, look out the window, play with your pet...anything, just MOVE. That simple action would have saved her life: it could save yours.

  69. TIL porting Zelda Classic from a Windows App to the browser

    He learned about each layer of the codebase, and how to transpile it down to the next layer until finally hitting Web APIs.

  70. TIL Computed Properties in Javascript

    Today I learned about Computed Property names.

  71. TIL outputting objects in Node

    In your Node projects -- sometimes you just need to output the object. Stringify it.

  72. TIL if TypeScript is worth it

    The answer: No, according to HackerNews. But HackerNews audience aren't exactly representative of average developers? From my perspective, they're the 'startup' and 'ship fast and break things' folks. (I mean, I am too!)

  73. TIL Very Efficient Code

    This is a great solution. Easy to understand. Executes really fast. No real-time string concatenation. No over-engineering. String appearance is easily customized.

  74. TIL delta time

    Delta time, also known as 'time delta,' refers to the difference between the 'current time' and the 'last time' a piece of code was executed. In JavaScript, delta time can be calculated using the Date object or by using the performance.now() method.

  75. TIL finding the browser being used

    How to detect the browser you're using, with javascript.

  76. TIL ChatGPT prompts

    Don’t ask it to write an essay about how human error causes catastrophes. The AI will come up with a boring and straightforward piece that does the minimum possible to satisfy your simple demand.

  77. TIL Libuv

    Libuv also implements two extremely important features of Nodejs which are the event loop and the thread pool and in simple terms, the event loop is responsible for handling easy tasks like executing callbacks and network I/O while the thread pool deals with heavy work like file access or compression.

  78. TIL brackets breaking elements in JavaScript

    The 'automatic semicolon insertion' it does is an error correction process

  79. TIL obscure search engines

    We all know the big ones like Google and Bing that have massive Indexes. THen we know about Wolfram Alpha and DuckDuckGo. But have you heard of Thunderstone?

  80. TIL IndexNow

    IndexNow is an open-source protocol that allows website publishers to instantly index across participating search engines, updating results based upon the latest content changes.

  81. TIL the fix everything script

    A script that fixes everything for end-users

  82. TIL RXJchess and how it was built

    How was this chess engine made?

  83. TIL all the different security roles

    In appsec most notably offense vs defense. They are complimentary of course but the skills differ. For offense you need specific tools, need to get used to testing applications sometimes without source code access.

  84. TIL Trovald's Magic Numbers

    These magic numbers are intended to safeguard against a typo or potential bit flips in the syscall number. Since reboot is a destructive and non-syncing operation, it's important to make absolutely sure that it isn't called accidentally due to a typo, a misbehaving program, or memory error

  85. TIL node modules fs and os

    with fs - you can access files, read files, make directories, chmod. With os - get stats, machine, version, hosts.

  86. TIL Node Streams

    Imagine if you did some data-extensive fetch request getting a 1 gig file. 1 gig can take a while, and it's fetching it in memory.

  87. TIL Websockets

    They offer a long lived, bidirectional communication channel between client and server. Once established, the channel is kept open, offering a very fast connection with low latency and overhead.

  88. TIL Node.js Event Emitter

    This is kinda like the addEventListener() for browser javascript.

  89. TIL Double Exclamation shorthand for booleans

    JavaScript (and TypeScript) lets you convert a non-Boolean value to Boolean using the double exclamation shorthand. '!!'

  90. TIL how to delete all cookies with Javascript

    If someone selects 'Reject', you want to remove all the tracking cookies. You can easily clear all cookies stored in a web page by accessing the cookie using document.cookie and clearing it.

  91. TIL Content sectioning

    Content sectioning or landmarks, like sidebar, content, footer. You know, like better names.

  92. TIL the Description List element

    Lists of name–value pairs (or, in some cases, name–value groups) are a common pattern across the web, in part due to their versatility. HTML lets us mark up these lists with a combination of three elements

  93. TIL MSW for mocking

    MSW is a API mocking tool. Mock by intercepting requests on the network level. Seamlessly reuse the same mock definition for testing, development, and debugging.

  94. TIL Sparse Arrays

    The ['Batman', , 'Bane'] array is a sparse array. See how it there is a blank?

  95. TIL accessing different data attributes

    You can access it in javascript using element.getAttribute('data-sandwich'). A better way is to go with the Element.dataset property.

  96. TIL aspect ratios

    We can target iframe elements directly with a few lines of CSS to preserve their dimensions in responsive layouts, without the need for a wrapper element.

  97. TIL Performance tests

    While doing performance tests, I was curious how long a loop was running. I used the performance.now() trick.

  98. TIL playing Tetris inside Zsh

    If you're using a Mac, you're probably using iTerm. 1. Load iTerm 2. launch emacs. 3. Launch Tetris.

  99. TIL about Ian Brown

    During the call, Musk said that Twitter would need to do a 'total rewrite of the whole thing' if it wanted to have a 'really high velocity.'

  100. TIL the history of fonts

    We came up with all sorts of clever techniques to do what was called 'image replacement' for text. Some of the techniques involved CSS and background images. One of the techniques involved Flash

  101. TIL getting the height with Javascript

    Say you wanted the height of a element. getComputedStyle gets you that. BUT -- it may lie about it to avoid css history leak. Instead use computedStyleMap.

  102. TIL not using try/catch block with promises for error catching

    You shouldn't use a try/catch block inside the Promise Definition. Your promise is already doing that.

  103. TIL Rainbow Books for CD formats

    Several volumes of specifications covering the topic, together called the 'Rainbow Books', were released over a period of 20 years from 1980 to 2000.

  104. TIL using proxies for reactivity

    A Proxy let you detect when someone gets, sets, or updates a property on an object, and run code when they do. But why? This usecase -- when you add/update the object, it also updates localStorage!

  105. TIL AggregateError

    I heard the term AggregateError in relations to 'Promise.Any', So it's several errors wrapped in a array. That's all.

  106. TIL newbie-friendly code code organization

    Adding clear conventions. One-way street data flow. Data structures. Stop it with Acronyms.

  107. TIL adding a helper function for CSS classes

    I like this helper. This lets you quickly add/remove CSS classes to your elements in a easy-to-read way.

  108. TIL how JSON bet on simplicity

    I had a goal of being able to put JSON standard on the back of a business card

  109. TIL JS Cron and process.platform

    Cron is a tool that allows you to execute something on a schedule. This is typically done using the cron syntax. process.platform tells you what platform the user is running. For this usecase, if it's win32, use robocopy. Else use rsync.

  110. TIL that Japanese sites are dark and dense

    In Japan, websites are often look incredibly outdated.

  111. TIL how Street Fighter 2's Title animation worked

    Looking at the spritesheet, how the heck does the small logo become the big logo?

  112. TIL fingerprinting with CSS

    Fingerprinting refers to building up enough metadata about a user that you can essentially figure out who they are. JavaScript has access to all sorts of fingerprinting possibilities, which then combined with the IP address that the server has access to, means fingerprinting is all too common.

  113. TIL functions in sass

    You can declare functions in sass using @function. You can even write for loops, return values, and even create @warn and @error.

  114. TIL CSRF Attacks

    Cross-site Request Forgery (CSRF) is submitting post data from a fake site. To prevent CSRF attacks, web applications should implement measures such as requiring a valid CSRF token to be included with each request, checking the referer header, and using secure cookies.

  115. TIL math module in SASS!

    math in Sass, oh my!

  116. TIL Little Big Details Easter eggs

    I was in search of Easter Eggs and found this Tumblr littlebigdetails.com. I was trying to find the easter egg in real life,,,. But it looks like the site switched to a JS framework. It looks very svelte, as it uses a lot of shadow dom elements!

  117. TIL the difference between a VPN and a reverse proxy

    A reverse proxy makes a private resource publicly available. A VPN lets you connect to a private network and access the resources on it securely when away from it.

  118. TIL passive aggressive easter egg

    Go to this corporate website and open the search (top right) and then submit with an empty search 7-8 times for a passive aggressive response.

  119. TIL Proving people wrong

    In chapter 3 where during training, a instructor said to another student, 'You're a tiny little man. Those waves will break you in half.' The student said, 'I won't quit.'

  120. TIL how to get what browser with just css

    Today I learned about how to tell what browser you are using with just CSS.

  121. TIL prepend

    When you're creating new elements in Javascript, you want to attach the new element to something that exists in the DOM already. You do that with append, and prepend.

  122. TIL the simulating a Pipe function

    It’s a pipe function that allows you to chain multiple operations together by taking a series of functions as arguments and applying them in a specific order to the input.

  123. TIL reverting git

    Two solutions. One is re-write history and hide your mistakes. The other is showing the history, to remind you of your mistakes.

  124. TIL NPM Christmas

    This cute binary from NPM lets you really kick off the holidays.

  125. TIL the Quake 3 Fast Inverse Square Root hack

    Quake III Arena, a first-person shooter video game, was released in 1999 by id Software and used the algorithm.

  126. TIL copy without overriding in command-line

    The cp command has a -n flag that you can use to prevent the copied file from overriding another file if one with the same name exists

  127. TIL how a game developer's obsession with karaoke paid off

    Initially, he says coworkers criticized him for going too far with the minigame – at the time, it was uncharacteristic to have the generally-stoic protagonist, Kiryu, doing something so goofy. But his instincts proved correct; it became one of the most popular features in the Yakuza series and went a long way in humanizing Kiryu.

  128. TIL using jq to turn JSON into CSV

    jq is like sed for JSON data - you can use it to slice and filter and map and transform structured data all within the command line.

  129. TIL the new Temporal API

    Temporal is a TC39 proposal for a non-sucky date time API

  130. TIL safe areas for mobile browsers

    The problem you quickly encounter is that the visible viewport is not per se the same as the interactive viewport. Mobile browsers tend to prioritize essential UI elements (like the home-bar on IOS) for interactivity at all times.

  131. TIL multiple ways to deal with extra 0s

    Dealing with lots of 0`s.

  132. TIL the difference between partial application and currying

    Partial application transforms a function into another function with smaller set of arguments. Currying creates nesting functions according to the number of the arguments of the function. Each function receives an argument.

  133. TIL the stack and heap

    The stack is a data structure that JavaScript uses to store static data. The Heap is Dynamic memory allocation, storing objects and functions. Garbage Collection.

  134. TIL more clean code principles

    Functions should either answer something or do something, but not both. If you use third-party libraries, wrap them. Throw errors.

  135. TIL Math.random() for design tricks

    Math.random() is awesome! However, if you dealing with sensitive applications and need a more secure method of randomization, I’d recommend WebCrypto.

  136. TIL self-hosting your own Google Fonts

    I'm all for self-hosting. So seeing this question asked 'Should you self-host Google Fonts?', my immediate answer is ABSOLUTELY. But here's the edge-cases.

  137. TIL how to convert a Callback to a Promise

    Callback functions work well for simple asynchronous operations, but can become difficult to manage and lead to 'callback hell' when dealing with more complex operations. Promises follow a specific pattern.

  138. TIL loading third-party scripts onto service workers

    An alternative to self-hosting scripts would be using Service Workers to cache them. This can give you greater control over how often they are re-fetched from the network. This could also be used to create a loading strategy where requests for non-essential third parties are throttled until the page reaches a key user moment.

  139. TIL IBM had corporate songs

    In 1927, Watson ordered the company to publish a songbook titled 'Songs of the IBM,' to be distributed to employees

  140. TIL about why Node was invented

    Node.js applications never buffer data, which dramatically reduces the processing time of uploading files, such as videos or audios. In other words, it simply outputs data in chunks, meaning that, for example, a user can watch videos without any interruption.

  141. TIL How to implement two-way binding without a framework

    One of the reasons we use React or Vue is because of that sweet sweet two-way binding. It's the automatic syncing of data between the model (data) and the view (UI) in both directions. Any changes made to the data will automatically update the view, and any changes made to the view will automatically update the data.

  142. TIL Event Delegation

    Event delegation is one of the most helpful patterns for DOM events! Adding too many event listeners means JavaScript is storing it all in memory. Event Delegation lets you store one listener, that then looks for the target.

  143. TIL what matters for JS optimization

    Optimizing your Javascript - Using getElementById() vs querySelector()? Doesn't matter. Loops? Doesn't matter. What matters: Render Blocking code, Repaints and Reflows, Memory allocation

  144. TIL that the max size of a Map/Set is 26843544

    JS Maps and Sets are implemented by OrderedHashTable. OrderedHashTables double in size when they need to grow, and their max size is 26843544. After 16777216 elements, doubling that exceeds the max, so the allocation fails.Currently these data structures are not implemented to be usable for large in-memory datasets. Also note that the JS specification itself doesn't require that Maps and Sets must scale with available memory.

  145. TIL ELI5 What an Operating system is

    If you traveled and wasn't able to speak the language, how would you get by? You would use a translator, who would help you around. But if everyone used a translator, tourists parties would quickly double in size.

  146. TIL Cleaner data structures

    Avoid unnecessary contexts, optional chaining, better error handling, avoid using flags

  147. TIL Cleaner Functions

    tl;dr - Limit the number of arguments, Avoid executing multiple actions in a function, Avoid mutation, Avoiding non-negatives, Return Early

  148. TIL jq and htmlq

    jq and htmlq, which are two command line libraries that make curl requests then return filtered data. jq is for json, and htmlq is for html!

  149. TIL A practical Curry Example

    Currying is a programming technique where you take a function with multiple arguments, and you turn it into smaller sequential functions where you pass one argument at a time. But many use-cases kinda suck

  150. TIL how NGINX knows to look for index.html vs index.php

    What happens when visitor hits /foo/bar URL?

  151. TIL php-fpm

    PHP runs as a separated service when using PHP-FPM. By using this PHP version as language interpreter, requests are processed through a TCP/IP socket; so that the Nginx web server only handles the HTTP requests and PHP-FPM interprets the PHP code. The fact of having two separate services is key for increasing efficiency.

  152. TIL the difference between single-threaded & multi-threaded architecture

    For web dev, we don't need it. We're not bottle-necked by the processing power. We're instead bottlenecked by the ability to read files/databases. We can simulate multi-threading (and improve our app's performance) using async/await.

  153. TIL HTTP "No-cache" headers

    Using PHP and apache .htaccess file to force reload

  154. TIL Windowing in Browsers

    Windowing only allow you to render what's available. Using twitter as a example, with tweets, when you scroll through hundreds of tweets and inspect the DOM, they just put a bunch of blank space above so there's not like 400 tweets above you.

  155. TIL aria-expanded for showing when things are hidden/shown

    The aria-expanded attribute is set on an element to indicate if a control is expanded or collapsed, and whether or not its child elements are displayed or hidden.

  156. TIL ARIA role presentation

    Think of this as a reset. You use role=presentation to remove semantic meaning from an element.

  157. TIL reduce-motion-blur

    Dizziness and vertigo are symptoms of a vestibular balance disorder. If the user has set up a user preference that they prefer motion-based animation be disabled/reduced, we can tap into that. As web developers, we can also support them.

  158. TIL Icon Fonts being the suckfest that they are

    In 99% of all use-cases, SVGs are better.

  159. TIL Decorative Images

    make a blank alt='' for presentation images - aka image might already be given using adjacent text, or the image might be included to make the website more visually attractive.

  160. TIL that adding a psuedo-h7

    Natively, there are 6 heading levels. What if accessibility-wise, you wanted a new heading level?

  161. TIL how outsiders see Javascript

    The bane of my existence - 'SyntaxError: Cannot use import statement outside a module'

  162. TIL a tool to generate contributors to a open-source github project

    I found this sweet tool that helps identify who are all the contributors to a project at contrib.rocks

  163. TIL Adapters, proxies, and decorators

    An adapter provides a different interface to the object it adapts. A Proxy provides the same interface as its subject. A Decorator adds one or more responsibilities to an object.

  164. TIL Prototypical Inheritance vs return functions

    When to use proto versus return functions?

  165. TIL super()

    When you use super(), it's like you're telling the new object to copy everything from the old object first, and then add or change anything else that's different.

  166. TIL the difference between Factory Pattern and Builder Pattern

    The factory method pattern requires the entire object to be built in a single method call, with all the parameters passed in on a single line. It may evolve into a builder pattern. A builder pattern is a wrapper object around all the possible parameters you might want to pass.

  167. TIL Open-Closed Principle in OOP

    In object-oriented programming, the open–closed principle (OCP) states 'software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.'

  168. TIL a code snippet to check if the value is of type

    This short snippet helps us check!"

  169. TIL the difference between Web workers, Service workers, Worklets, Websockets

    Web Workers are scripts that offload work from the main thread. Worklets connect to the rendering pipeline. Websockets opens up a 2-way connection.

  170. TIL good numbers for Web Metrics

    Given that the 'good' FID threshold is 100 ms, we can say that at least 90% of websites meet this bar. In fact, we know from the analysis done in the Performance chapter that 100% of websites actually have good FID experiences on desktop devices, and 92% on mobile devices. FID is an unusually permissive metric.

  171. TIL avoiding including Sourcemaps

    Sourcemaps are a base64 representation of the original source into a production-ready JavaScript asset.

  172. TIL switching over to Service Workers with Chrome extensions

    Background Pages are like 'hidden pages' that a developer would create behind the scenes. That hidden page would do various JS needs to simulate functionality. Vs a service worker is a script that your browser runs in the background, separate from a web page, opening the door to features that don't need a web page or user interaction

  173. TIL using defer/async

    So an old and often-touted best practice for performance has been to load your JavaScript in the footer of the document to avoid render blocking of scripts. By putting it in the footer, the DOM is constructed before your scripts have a chance to run. That's dumb.

  174. TIL about console.dir

    If you console.log a element, you will get it's HTML markup. If you want it as a JS object, use console.dir instead

  175. TIL about youtube-dl

    youtube-dl is a command-line program to download videos from YouTube.com and a few more sites.

  176. TIL Breath of the Wild's many parameters

    One of my favorite things to do is dig into how games are made on the data side.

  177. TIL Npx npm-check-updates

    Updating packages is frequent chore to do so you are always running the latest security patches.

  178. TIL npx

    This command allows you to run an arbitrary command from an npm package (either one installed locally, or fetched remotely), in a similar context as running it via npm run.

  179. TIL Replace Only Fixes the First Encounter

    Replace only finds the first occurrence. ReplaceAll fixes it all.

  180. TIL Resume-Driven Development

    The selection of technologies is given highest priority in the current field of activity. Moreover, future employers and jobs may specifically be chosen according to these criteria.

  181. TIL the difference between startups and stable

    On a stable team, you're working on handling features, patching up insecurities, and maintaining the ship. The ship is working. But someone still needs to do maintenance to keep it at sea. At a startup, you're fighting for your right to survive. This metaphoric ship is both at sea, while also being built. You're learning instantly to deliver immediately. (and for most startups, job security is often uncertain)

  182. TIL reusing variables

    Do not reuse variables. Do not double define variables that represent the same thing.

  183. TIL @Supports

    Unsupported CSS can break things. You typically wrap it in a @Supports rule.

  184. TIL what a Shader is

    Modern GPUs are incredibly flexible. Developers use shaders - to program the GPU to perform effects and complex rendering techniques. Devs write code in a shader language from an API (such as OpenGL) and a shader compiler in the video driver translates that code into binaries that your PC's GPU can run

  185. TIL Optional chaining broke his mom's site

    Modern browsers get all fancy new features. But what about still-working technology like 1st-gen iPads and old chromebooks that no longer get updates?

  186. TIL Cherry-picking out of bootstrap-vue

    If you are using a component library that uses ES modules like bootstrap-vue, you can cherry pick its components instead of just registering all of them globally.

  187. TIL Avoiding promise chains

    Callbacks are functions that are executed when another function finishes. It can lead to callback hell, which instead, use a promise! But don't make promise chains

  188. TIL use-cases for Generators in Javascript

    Generators are functions that can be exited and later re-entered. Their context (variable bindings) will be saved across re-entrances.

  189. TIL Animista for generating CSS animations

    Animista is one of the best CSS tools you can use for animations. It gives you a collection of pre-made animations that you can use in your CSS.

  190. TIL Memoization performance

    Memorization in a nutshell: You catch the data if it exists already.

  191. TIL John Romero had 74 games and 3 startups fail before making Wolfenstein 3D

    Before Wolfenstein 3D, John Romero had given himself something new to learn: random maze generation; joystick input; music.

  192. TIL Microservice vs Monolith

    Final Verdict: You can do way more damage setting up a microservice architecture incorrectly in the long run than a really bad monolith.

  193. TIL generating fancy waves for HTML

    Get Waves is another amazing tool that will allow you to create SVG waves for your projects using CSS. It makes it much easier, you just choose the options, then the tool generates the right CSS code for your wave design.

  194. TIL filtering DOM elements when you web-scrape

    I love web-scraping. One core technique you have to master is stripping HTML from a string.

  195. TIL about Leaflet, an open-source Google Maps alternative

    I love how flexible Google Maps is for developers. But to use it for commercial products, it's a bit expensive. I learned about Leaflet — an open-source JavaScript library for interactive maps.

  196. TIL event bubbling

    Event bubbling is when an event is in an element inside another element, and both elements have registered a handle to that event. That cause collisions.

  197. TIL writing a clean function

    Write an assert at the beginning of the function. Then, write down all the conditions that must be met.

  198. TIL about the proposed pipe operator

    In functional programming, you chain functions to provide a result. Witht he Pipe operator, it can look like this: const total = money |> removeOneDollar |> addTwoDollars |> addFiveDollars

  199. TIL how to use ':where()'

    You can probably also use a helper class like `no-bullets`. But this method does follow a default top-down approach pattern with CSS that i'm starting to also fall in love with.

  200. TIL different ways to inject content via Javascript

    There's lots of ways to do things in Javascript. It gets difficult to know which way is the 'preferred' way.

  201. TIL using Event Delegation

    It's cheaper for the browser to track one event and fire it on every click that it is to manage multiple events.

  202. TIL Web scraping with node

    Fetch the data, traverse the dom, and return the data.

  203. TIL a sweet SVG clip-path generator

    The clip-path CSS property creates a clipping region that sets what part of an element should be shown. Parts that are inside the region are shown, while those outside are hidden.

  204. TIL about going straight into the ask

    Don't ask to ask, just ask. Attention is a limited resource. If you work remotely, it's even more important to just get straight to the point.

  205. TIL being a old developer

    Every inspirational, blue-sky, brainstorming meeting or demo session has a person that keeps disrupting the flow. A battle-hardened, highly experienced developer with lots of memories of how things failed in the past. A person who a lot of people look up to and whose input counts as important. The even bigger problem is that this grumpy old person lives inside my head.

  206. TIL Searching a static site

    Without a database to query for it, there's no built in-search query. Create your own search query system. (with a fallback where it opens up something like Duck Duck Go).

  207. TIL prefers-color-scheme automatically

    For swapping between light mode and dark mode, you don't need JS. Using the `prefers-color-scheme`, that will automatically run the design code based on the user's preference.

  208. TIL Why use Closures

    Now you might be asking, why even use it? Why not just flatten it out so it's just one function with one return statement?

  209. TIL Accessibility in Devtools

    You can enable the Accessibility Devtool (currently in experiments mode) to do screenreader testing.

  210. TIL using html comments in javascript

    This is in the 'bad idea' area! But just a need little factoid!

  211. TIL the difference in the JS Event Loop for Browsers and Node

    It took me years to understand this. Someone saying that 'they use Javascript' could mean they use Javascript on the web, or Node, or a different Javascript environment, of which there are MANY!

  212. TIL Samuel L Jackson Lorem Ipsum

    Probably not work-safe. But no more will you deal with boring placeholder text.

  213. TIL a junior dev who programmed a World Heroes Genesis by himself

    Yeah, World Heroes (even the original) wasn't anything to write home about. I had to squeeze 82M into a 16M cartridge. The source code was in assembly with absolutely no documentation. There were no testers. There was no one to help me port the artwork.

  214. TIL Clippy for generating clip-path art

    Clip-path allows you to define a shape that will determine what parts of your HTML element are shown. You can use it to create all different kinds of shapes!

  215. TIL Promise Constructor edge-case

    The promise constructor has to do a few more workarounds in order to catch errors. Just use a then statement

  216. TIL How to auto-grow textarea with pure css

    To do this, you replicate the content of the '<textarea>' in an element that can auto expand height, and match its sizing.Same font, same padding, same margin, same border… everything.

  217. TIL Disable users from highlighting text

    You can use the 'user-select' property to prevent an element from being highlighted by the user.

  218. TIL more Javascript Environments

    This is back to why Web Interop exists! Because we have a specific Javascript standard (via ECMAScript Language Specs, by the TC39), and many many different companies/businesses who implement Javascript.

  219. TIL Microsoft Teams can analyze your feelings

    Microsoft Teams set up a new feature set. They're known as Purview classifiers that can help prevent abuse, harassment, other illegal activities on Teams.

  220. TIL Korok seed puzzle pattern

    Why I love this is that the designers thought up a few puzzle categories, and sprinkled the open world with these. It creates a very effective piece of optional game play.

  221. TIL High Resolution Time

    The Date object is no longer the recognized method for timing events because it is very imprecise and can be modified by the system clock.

  222. TIL what pwd means (and a bunch of others)

    It's short for print working directory

  223. TIL about some sites to inspire you

    After years of web development, I've come to the conclusion that these sites are simply the most beautiful sites ever. If you ever need a inspiration, here you go.

  224. TIL the Doherty Threshold

    If a computer responds to a users input in less than 400ms, the user will take less time to make their next decision.

  225. TIL Number formatting with Javascript

    Say you wanted to convert this into a string, with all the commas and everything. You can use the browser Intl package to use this.

  226. TIL refactoring object lookups to avoid looking at the prototype chain

    Depending on your lookup method, you can access the prototype chain, which opens up some potential vulnerabilities or terrible side effects!

  227. TIL tips for making a API Wrapper

    The API wrapper should do zero 'interpreting' (or as close to zero as you can get).

  228. TIL about heavy.js

    It downscales all images on your webpage by a factor of 3, takes the RGB values and creates spans with appropriate styles. Yes, this converts your images to HTML p and spans.

  229. TIL about semaphores

    A semaphore limits access to a resource to some number of consumers. Any new requests for the resource will get stalled until later, eventually to be handled.

  230. TIL cancelling promises

    There is a cross-platform (Node, Browsers, etc) cancellation primitive called AbortController. You can use it to cancel functions that return promises rather than promises themselves.

  231. TIL software interoperability

    The term 'software interoperability' refers to the capability of different solutions to communicate with one another freely and easily. Systems that are interoperable exchange information in real-time, without the need for specialized IT support or behind-the-scenes coding.

  232. TIL the Shared Element Transitions

    These cool effects exist on mobile. And Google and the Chrome team has been pushing for the web to have those complex transitions too.

  233. TIL Considering Device Obsolescence with web development

    I'm incredibly guilty of pushing to build for the latest tech. For good reason too - you can write less code, use more native functions, and things are just more likely to work.

  234. TIL constant failures

    I've missed more than 9000 shots in my career. I've lost almost 300 games. 26 times, I've been trusted to take the game winning shot and missed. I've failed over and over and over again in my life. And that is why I succeed

  235. TIL Morrowind would reboot the XBox if it ran out of memory and hide it behind a loading screen

    One of my favorite tricks for Morrowind is that if you are running out of memory [on Xbox], you can reboot the Xbox without the user knowing. So if you had a really long loading time, that was us rebooting the Xbox.

  236. TIL the WebCrypto API

    If you dealing with sensitive applications and need a more secure method of randomization, I’d recommend the Crypto API. Reasons you may want to use WebCrypto include temporary verification codes, random password generation, randomized lottery numbers, etc.

  237. TIL another way to prevent buttons from submitting HTML

    When you have two buttons, you can use 'type=button' to stop them from submitting a form.

  238. TIL asciinema

    A frequent scenario that I use to teach my team is recording videos of doing terminal commands.

  239. TIL the first computer bug

    On September 9, 1947, a team of computer scientists and engineers reported the world’s first computer bug. The team at Harvard University in Cambridge, Massachusetts, found that their computer, the Mark II, was delivering consistent errors.

  240. TIL the @layer feature in CSS

    With '@layer', the entry file can pre-define layers, and their order, ahead of time.

  241. TIL ES6 Proxy's apply method

    Using JavaScript proxies you can wrap an existing object and intercept access to its attributes or methods, even if they don’t exist. You can also redefine fundamental operations for that object.

  242. TIL ES6 Proxy

    Using JavaScript proxies you can wrap an existing object and intercept access to its attributes or methods, even if they don’t exist. You can also redefine fundamental operations for that object.

  243. TIL about the Clipboard API

    The Clipboard API can be used to implement cut, copy, and paste features within a web application.

  244. TIL linux user groups

    UID 0 is reserved for root user. UID 1-99 is reserved for other predefined accounts. UID 100-999 is reserved for system accounts. Also notice that user accounts tend to start at 1000. UID above 999 are for normal user accounts.

  245. TIL Deceptive design patterns (dark patterns)

    Deceptive design patterns (also known as dark patterns) are tricks used in websites and apps that make you do things that you didn't mean to, like buying or signing up for something.

  246. TIL how a MRI disabled iOS devices in a facility

    It wasn't a EMP. It was helium gas.

  247. TIL how to explain Typescript like i'm 5

    Typescript is quickly becoming a powerful tool for Javascript developers. Typescript provides optional static typing.

  248. TIL how to create randomware in nodejs

    As a developer, it's important to know the power we have in our hands, and how to execute and defend against it/avoid it. Running randomware attacks is illegal.

  249. TIL the wbr element

    '<wbr>' is a HTML element that represents a word break opportunity—a position within text where the browser may optionally break a line, though its line-breaking rules would not otherwise create a break at that location.

  250. TIL the original Pong was pure hardware

    A simple gate example would be a OR gate. It gets two connections on the input side and 1 on the output side...

  251. TIL about going up and down in your bash history

    Your bash history is saved with up/down arrow keys. Which means you shouldn't save your passwords on it.

  252. TIL a short explainer of the Execution Context

    It is an abstract concept that represents the environment in which JavaScript runs. What happens inside the execution context is two things basically. The first is parsing the code line by line and the second is storing the variables and functions into the memory.

  253. TIL about this work of beautiful code

    I'm a strong believer in writing code for tomorrow's developer. I'm incredibly anti-code-golf. (It's a beautiful art form, but keep it out of production code!)

  254. TIL the origins of the term Algorithms

    Muhammad ibn Musa al-Khwarizmi's name is a reference to where he was from — 'al-Khwarizm' means that he was from Khwarazm, a region roughly on the border of modern-day Uzbekistan and Turkmenista. Al-Khwarizmi was, somehow, recorded as something close to 'Algorizmi' which, in turn, became our all-purpose math word: algorithm.

  255. TIL how images get displayed to the browser

    Image data is usually encoded in order to reduce file size. You can change when to decode the image.

  256. TIL CSS Vulnerability in Yahoo Mail

    CSS doesn't immediately fail on parse errors. In 2009 it turned out Yahoo Mail was vulnerable to a fairly simple exploit. The attacker sends the user one email with a snippet of code and another email to run the code

  257. TIL onError

    When a resource (such as an img or script) fails to load, an error event using interface Event is fired at the element that initiated the load, and the onerror() handler on the element is invoked.

  258. TIL addEventListener's third param

    The mysterious useCapture and options.

  259. TIL to minimize internally-made acronyms

    Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees.

  260. TIL add link decoration to help with accessibility

    One of the WCAG requirements is not to rely on color only when you want to distinguish a button or link from the rest of the text. Painting links in blue or another color doesn’t suffice since it still might not be visible for people with color blindness. The most typical method is underlining links; they can also appear in bold font.

  261. TIL the global attribute translate

    A good use-case is if your brand has words that can be translated.

  262. TIL default spellcheck in html

    The spellcheck is a global attribute that you can use to check spelling and grammar on HTML elements such as input fields and other editable elements.

  263. TIL the multiple value in html

    The multiple attribute allows the user to enter multiple values on an '<input>'. It is a boolean attribute valid for file or email input types and the '<select>' element.

  264. TIL how CORs work

    We kinda need images to work regardless of what site they're on. I should be able to steal a image from your website and host it somewhere else. Same with JS code (Like CDNs!) But we also don't want the problem above where I can test your cookies to see if you're logged into your bank account.

  265. TIL adding an Event Listener to document

    When an element in the DOM is clicked, the event bubbles all the way up to the parent element (the document and then the window). This allows you to listen for events on the parent item and still detect clicks that happen inside it.

  266. TIL what jQuery's role is today

    Today’s JavaScript frameworks allow us to break the UI into components, making it easier to scale up an application. It creates abstractions for easier synchronization between the data and the view. We don't need to hack the DOM element directly, and instead let the framework handle it.

  267. TIL the history of jQuery

    With the launch of jQuery in 2006, web developers were able to access and manipulate DOM and CSS faster and easier than ever before.

  268. TIL an easy way to make rainbow text

    You can create gradient text by tweaking just three simple properties: background-image, color, and background-clip!

  269. TIL a Accessible way to solve Read More

    Screenreaders help sight-impaired visitors have a better experience. The most annoying thing on a news website is to hear this: Read more — link, read more — link, read more — link. There's two ways to solve it.

  270. TIL obvious security vulnerabilities and prototype pollution

    Object-based inheritance gives JavaScript the flexibility and efficiency that web programmers have come to love – but it also makes it vulnerable to tampering. Malicious actors can make application-wide changes to all objects by modifying object, hence the name prototype pollution.

  271. TIL about Oil in Game dev

    It 'feels' wrong when Link gets stuck on a block. Nintendo is fantastic at 'oiling', smoothing out this process so Link automatically moves downwards when he hits a block.

  272. TIL how to open up your webcam with html

    This is done with the 'capture' attribute which can take two values.

  273. TIL Never deserializing untrusted data

    This happened the most in PHP, because for some reason, PHP developers love to serialize/deserialize objects instead of using JSON, but I’d say almost every case we saw where a server was deserializing a client object and parsing it led to a horrible exploit.

  274. TIL different ways to paginate API calls

    When exposing large data sets through APIs, it needs to provide a mechanism to paginate the list of resources. That way, instead of 365,000 tweets shared... maybe you're sharing segments of 1,000 tweets. Smaller payload, faster delivery, less angry person.

  275. TIL a funky bug that crashed Google Docs

    On May 5, 2022... a user crashed Google Docs by typing: And. And. And. And. And.

  276. TIL the different Javascript Engines

    There's dozens of JS engines. V8 ,Chakra, Spidermonkey, JavascriptCore Webkit, JerryScript...

  277. TIL blogpost - training new hires

    A few months ago, I shifted from Wizbang Codemonkey to Lead Cat Wrangler (non-official titles obviously). My team went from six devs to thirteen in less than a year. And I would be in charge of managing a brand new team, as WELL as all the new hires. The Peter Principle is always a concern.

  278. TIL how to create adaptive SVGs

    SVG markup is XML using an .svg file type extension which allows it to hold more dynamic types of code. SVG is able to scale up and down without quality loss, and can potentially be very small in size, they can also have embedded CSS, even embedded media queries.

  279. TIL about what causes Memory leaks in Javascript

    As long as it is possible to reach it, keep it. Everything else gets yeeted.

  280. TIL JS in Google Sheets

    I like this because I do use a lot of Google Sheets, and I write a lot of Javascript. And together, they can be a quite a force to be... calculated.

  281. TIL how Node/V8 works with imports/exports

    This is accurate only up to how JS works in Chrome-based browsers, and NodeJS, as Node uses V8 under the hood. But overall, it's referencing vs live binding

  282. TIL Serverless Functions instead of a backend service

    Back in the day, you had to spin a server. Now you can just throw it on the cloud.

  283. TIL about Micro-frontends

    Micro frontends are a new pattern where web application UIs (front ends) are composed from semi-independent fragments that can be built by different teams using different technologies.

  284. TIL about Edios-Montreal's dialog system

    These are the top-level goals the team needed to create with Codex. String IDs needed to be easily readable. Game scripts needed to be playable fast. Pain-free iteration. Ensemble recording. Fast audio importing. Easily provide context and error-checking for localization.

  285. TIL these game design resources from Alex (@TychoBolt)

    These two massive docs that contain a wealth of info.

  286. TIL the meta refresh redirect method

    A Meta refresh redirect is a client-side redirect. Unlike 301 and 302 redirects that happen on the web server, a meta refresh redirect instructs the web browser to go to a different web page after a specified time span

  287. TIL of the base element

    base element adds the domain link to all relative links.

  288. TIL of the difference between || and ??

    The difference between || or ??

  289. TIL about more examples of currying

    Currying is nothing more than a way to transform functions that accept multiple parameters into a sequential list of functions that take only one parameter each.

  290. TIL you can make your cursor display images

    The cursor element allows you to use 'url()'. It's required to include a fallback keyword (like 'auto') in case the image is broken.

  291. TIL how a url goes gets data from the internet

    Ever wonder what happens when you type a url in a address bar in the browser?

  292. TIL some more examples of closure

    Five benefits- Private variables and methods. Data hiding and encapsulation. Currying. Function Factories. Performance

  293. TIL about Partial Hydration

    Partial rehydration is an extension of the idea of progressive rehydration where individual pieces of a server-rendered application are 'booted up' over time. This contrasts with the approach of initializing the entire application at once.

  294. TIL about Interop 22

    interoperability — when each underlying web technology is implemented in the same way in every browser

  295. TIL what Single Threaded & Non-blocking means in JS

    Javascript is a single-threaded language. This means it has one call stack and one memory heap. Non-blocking means it'll read from top to bottom and throw anything async in the queue.

  296. TIL a nice checklist/strikethrough animation

    Animating checkboxes by using the `:checked` pseudo-class. If it's true, then include other things (like a before/after psuedo-class with other effects.)

  297. TIL about the 11,000 line file

    At work, I discovered a core project file that is almost 4,000 lines of code. Code flowed from top to bottom. I thought this is what nightmares are made from.

  298. TIL what the Diffie-Hellman Key exchange is

    SSH uses RSA to establish an initial secure, authenticated connection, then uses Diffe-Hellman to establish an ephemeral (ie: one time) key to establish forward-security.

  299. TIL how to create a delay snippet for JS

    We check for any user interaction. The 'eventList' array has eventlisteners, listening to those movements. Or we wait 5 seconds. Then Switch the 'delay' attribute with 'src' attribute. Run the 'cookie.js' code!

  300. TIL you can make SMS links

    So you can make a 'mailto:' and a 'tel:' link. But did you know you can also do 'sms' messages too?

  301. TIL how to make numbers the same width and prevent shifting layout

    If your font supports it, you can use 'font-variant-numeric: tabular-nums'.

  302. TIL using datalist for a pure HTML input suggestion

    Web developers do not use the power of 'datalists' enough. It combines the power of a 'selector', with the ability to type out your choice using the keyboard.

  303. TIL about the element.closest() method

    Using a single event listener is super efficient, but has edge-cases. So using closest instead of match.

  304. TIL some JS tree traversals

    Ah, DOM tree traversal. It's the adventure that keeps on giving.

  305. TIL of things to avoid at big companies

    Being someone's lieutenant, Tribal knowledge, Falling for perks, Getting raises, not readjustments, Lack of recognition.

  306. TIL how to set up autogrowing textarea fields

    There's some css tricks to autogrow textarea. There's also a nice piece of JS to use to do it as well!

  307. TIL of a reference to quote the price of a website

    Look, you can live in a generic rental with popcorn ceilings, odor-catching rugs, paper-thin walls and the cheapest appliances. Or you can live in a nice apartment with 10ft ceilings, hardwood floors, soundproof walls and modern appliances.

  308. TIL about IPv4 Private IP addresses

    The IP '10.0.0.1' is a Class A address. The IP '172.16.0.1' is a Class B address. The IP '192.168.0.1' is a Class C address.

  309. TIL of the selectopt group

    You can create some cool dividers for your field options using the 'optgroup' element.

  310. TIL you can wire different inputs to different forms

    You can add the form element inside a input, to point specifically to the form you want to target.

  311. TIL how my team used web components

    I'm sure this site is from like 2002 or something (I don't exactly know). This was a super quick task. And from the looks of it's age, we just wanted to get it done quickly.

  312. TIL of what happens when you put a random url in your DNS records

    So when you use a 'A' record, it points to the IP address. If you put a site you don't own, and it gets redirects, it'll 404 because the header metadata!

  313. TIL about Negative Caching

    If you're ever working on a site and get a 'Server Not Found', then fix it (so that it totally works), and you STILL get a 'Server Not Found', that's negative catching!

  314. TIL of using the "is" property

    The ':is()' CSS pseudo-class function takes a selector list as its argument, and selects any element that can be selected by one of the selectors in that list.

  315. TIL about switching out of JS Classes and into JS Modules

    A classes are just blueprints for creating objects. A class encapsulates data and functions that manipulate data. A module is a file that exports features, such as variables, objects, and functions, that can be used elsewhere.

  316. TIL of this repo who made box shadow images

    That's right! You can make a single-pixel box shadow. You can also create multiple versions on the same line.

  317. TIL SpaceX ships run Chromium

    HTML/CSS is good enough for space.

  318. TIL about Cypress Custom Commands

    Today I learned adding custom commands to Cypress to abstract common patterns, using the Cypress.Commands.add()

  319. TIL how WordPress does serverside

    This isn't fully accurate, but for the means of describing server-side rendering, it's a good start!

  320. TIL about the End of Time! (for Unix)

    On January 19th, 2038 at precisely 03:14:07 UTC, instead of the clock going to 03:14:08 UTC, it will overflow and go to 20:45:52 UTC of December 13th, 1901.

  321. TIL of a guide for naming things

    Naming is hard. Naming is important because '.imgFloatLeft' no longer is accurate when we switch to 'ltr' format.

  322. TIL of a visual way to see CSS Cascade

    But then questions start arising: is !important higher priority than say, the Shadow DOM generated object?

  323. TIL how to quickly create a .nvmrc file

    all you need is 'node -v > .nvmrc' and let the magic happen

  324. TIL about the Network+ troubleshooting methodology

    Honestly, it's one of those things where if you break down a real problem, you probably already do all of this.

  325. TIL different Fiber Networks

    My various notes on the Network+ exam for Fiber Networks.

  326. TIL How to memorize certain IEEE 802 standards

    The IEEE 802 is a collection of networking standards that cover the physical and data-link layer specifications for technologies such as Ethernet and wireless.

  327. TIL Ethernet wire colors

    Ethernet wires are more than just 'a cord'. It's 8 tiny wires.

  328. TIL how to create tables in markdown

    To create a table in markdown, you literally draw a table out using pipes, and dashes.

  329. TIL How to remember the OSI Model

    Please do not throw Sausage Pizza, Asshole.

  330. TIL Wi-FI Generations

    Wifi versions and generations.

  331. TIL Cell Phone technology and mobile phone generations

    The various mobile phone generations and where we are now.

  332. TIL Types of hacks and how to defend against them

    On the Network+ exam, there were a few different methods of attacks. This is my notes on them.

  333. TIL Port Numbers

    This is my own cheatsheet for remembering port numbers.

  334. TIL about Syslog Severity Levels

    Syslog is a protocol to manage your network devices.It's a score from 0 to 7 to determine severity.

  335. TIL ELI5 for Docker & Kubernetes

    Kubernetes is the service that manages all the docker containers to ensure there's enough resources for everything to operate.

  336. TIL alternative open-source viewers for social media

    A lot of websites require you to log in to use their services. Reading a twitter thread, and suddenly, you get blocked and have to log in. Not anymore!

  337. TIL about Port 17, QoTD

    A host may connect to a server that supports the QOTD protocol, on either TCP or UDP port 17. To keep the quotes at a reasonable length, RFC 865 specifies a maximum of 512 octets for the quote.

  338. TIL 404 errors actually have more specific causes

    IIS 7.0 and later versions define the following HTTP status codes that indicate a more specific cause of an error 404, like 404.1 - Site Not Found & 404.2 - ISAPI or CGI restriction.

  339. TIL that Xbox has a accessibility Guidelines

    The guideline also provides `gamer personas', types of gamers who are affected by that specific issue and how your accessibility solution will help them.

  340. Grouping console messages together

    You can wrap console messages together using console.group('name') and console.groupEnd('name')

  341. TIL about console.assert()

    You can instead use console.assert() to show conditional errors

  342. TIL about wrapping a variable in curly brackets

    Output the key:value pair using curly brackets

  343. TIL how to replace many characters in javascript

    You can use the replace() method to swap one string pattern for another.

  344. TIL about 'chumps' in BioShock

    In Bioshock Infinite, they have 'chumps' without AI, without the ability to pathfind around - just bodies looping animations with a few flourishes like voice lines.

  345. TIL about some neat notepad tricks

    'F5' generates a timestamp in notepad. And adding a timestamp using .LOG on the 1st line of a text file.

  346. TIL about the Network Information API

    The Network Information API provides information about the network types(e.g., 'wifi', 'cellular', etc.), save data mode, bandwidth and many more.

  347. TIL ELI5 for GraphQL

    ELI5? It's like a lunch tray, properly portioned and asking for a specific food type in each slot.

  348. TIL about getting how long it takes for JS to execute

    This post took me 7.22 minutes to write.

  349. TIL about the battery status API

    Do you want to know all about the battery of your laptop, PC or, devices? This API helps in knowing all the information like, the battery is charging or not, how much charge is left and also the handlers to handle the charge related state changes.

  350. TIL Spreading a object into another object

    It's copying an object into another object, while also adding a new input.

  351. TIL Blogpost, What New Hires think about

    New hires come in with a lot of unknowns. They also don't have psychological safety to open up.

  352. TIL about the Broadcast Channel API

    Think of a use-case like, once you logout from an app running in a browser tab, you want to broadcast it to the app instances opened in other tabs of the same browser.

  353. TIL ELI5 for Async Await

    If you make a call to a friend across the world, it'll take 20 seconds before they respond. You can't just wait 20 seconds. So you run other code.

  354. TIL that 2^24 items will cause a interesting error

    Obviously there's not much real use-cases. But that's the fun of finding limitations.

  355. TIL about the Image Capture API

    The Image Capture API which helps us to capture an image or grab a frame from the video devices(like webcam). Not only that, you can also perform actions on capturing an image or grabbing a frame.

  356. TIL about Concurrency

    It means tasks can overlap.

  357. TIL about a a 12 year old bug that finally get's squashed.

    Someone noticed a potential optimization issue, and the technical debt piled on thanks to new features, encapsulating them for reusability, then calling them over and over.

  358. TIL about joke variables names in WordPress

    The vast majority of users are likely unaware of this joke unless they enjoy trawling through the 6,000+ lines of code in '/wp-includes/formatting.php'. There is a good chance that any developer who has looked up the 'wpautop()' function has stumbled upon it.

  359. TIL how to add custom styles in WP Blocks

    Justin Tadlock of WPTavern recreates a theme in block patterns.

  360. TIL ELI5 for Dependency Injection

    In a nutshell, what it means is that any given piece of code you write should be provided everything it needs to do its job, instead of creating things for itself.

  361. TIL of this switch shorthand

    Using a switch statement to fire a function? Nah, just fire it.

  362. TIL Numeric Separators

    This is spicy ES2021, and super useful for big numbers.

  363. TIL ELI5 for Smoke Testing

    It's about doing some basic surface level tests. If any of them are goofy, then something is wrong.

  364. TIL how to convert a nodeList into an array

    You can use the spread operator to turn a nodelist into an array!

  365. TIL how to pass unlimited arguments to a function

    The rest parameter syntax allows a function to accept an indefinite number of arguments as an array, providing a way to represent variadic functions in JavaScript.

  366. TIL using live regions for autocomplete accessibility

    However, the screen reader does not recognise this as an action to tell the user about. It will announce the header and the input box when they gain focus, but not the search results.

  367. TIL how to get the location of the user with the Geolocation API

    You can get the user's location in the browser. First, the user has to accept this. As it's a security request. Second, you use the Geolocation API.

  368. TIL a easier way to check for multiple OR statements

    Essentially, it's turning a multiple conditional into a array, then array to see if it matches.

  369. TIL about Debouncing/throttling

    Debouncing and throttling are too common techniques for dealing with things that happen 'too often', like typing.

  370. TIL of someone who missed all the JS pitfalls

    If JS doesn't do it the way they think it works, then... JaVaScRiPT is STUPID!

  371. TIL about the new Intl.NumberFormat browser API

    No more stupid-ass hacks to format numbers correctly.

  372. TIL Chrome can emulate mobile hardware

    Chrome can emulate device hardware in DevTools — choose Sensors from the More tools menu

  373. TIL of returning true/false directly

    return true or false directly bruh

  374. TIL of a nice ELI5 of code splitting

    Code splitting is the splitting of code into various bundles or components which can then be loaded on demand or in parallel

  375. TIL How to determine what security group you're in

    These commands will help you figure out what group you're in, and if you belong to the group that can modify files.

  376. TIL the word Sanitize is too overloaded

    Sanitize means too different things, depending on context. Use Filtering, Escaping, Validation, or Protect instead.

  377. TIL Blogpost - my road to coding

    Started from the bottom now im herr

  378. TIL the one-banana problem

    Banana problem: Supposedly from the notion that a trained monkey could do what is required. At IBM, they divided the world into one, two, or three banana problems.

  379. TIL this glorious website - No Hello

    Nothing worst than the dreaded 'Hello', followed by silence. Just start talking.

  380. TIL the Bus Factor

    The bus factor of a project is the number equal to the number of team members who, if run over by a bus, would put the project in jeopardy. If a project overly relies on the contributions or knowledge of one person, then you could say that the project’s bus factor is one.

  381. TIL trailing commas in Javascript

    JavaScript has allowed trailing commas in array literals since the beginning, and later added them to object literals, and more recently, to function parameters and to named imports and named exports.

  382. TIL you can share multiple users between WordPress installations

    You can use the same userbase for all your blogs on the same domain by defining the CUSTOM_USER_TABLE and optionally the CUSTOM_USER_META_TABLE constants to point to the same wp_your_blog_users and wp_your_blog_usermeta tables.

  383. TIL more scary floats in Javascript

    using floats with parseInt can cause unexpects side effects

  384. TIL World of Warcraft had a Developer Island in production code

    This developer island was only for devs, and was used because some bugs couldn't be reproduced on dev servers

  385. TIL this bug that deleted all /usr stuff

    Classic mistake where the dev wrote a rm -rf that deleted the folder

  386. TIL how to append a date to a filename in Node

    My goal was to create a helper function that allows me to build a new file, and append a date to a filename for logging.

  387. TIL getting all files with an extension in Node using Glob

    This helper function to get all the files that end in a specific extension in node

  388. TIL unzipping a file in node using zlib

    Since my application needs to read whatever is inside that '.gz' file, I had to figure out a way to simplify that. That was done with zlib.

  389. TIL startWith

    Getting a boolean result of true or false, depending on if the string startsWith a specific substring

  390. TIL a quick recipe involving Axios and Cheerio

    A quick recipe to http request an api and use cheerio to web-scrape it

  391. TIL doing things that makes your team's lives easier

    What can I do to make my team (team lead, teammates, managers, other teams) lives easier?

  392. TIL about AutoHotKey

    When you're getting annoyed at running the same commands over and over again.

  393. TIL How to highlight specific lines in bitbucket

    You may want to highlight specific lines in bitbucket by using #lines-1,2,3

  394. TIL How a virtual dom works

    Then, the Virtual dom compares diffs from old virtual dom, and then reapplies it. We apply the minimal amount of changes.

  395. TIL Blogpost - These 6 rules created a really dope culture at my job

    In almost any televised sport, watch the players. Teammates high five. Win or lose, opponents say 'good game'. Players tend to be good sports. It's rare to seeing players belittle a fellow teammate. Because at the end of the day, it's just another day. It's just another game. There's a thousand more. And another opportunity to shine.

  396. TIL Vue's Render Function

    A good example is that you want to generate a lot of list items, and writing them in the '<template>' section makes it look like spaghetti.

  397. TIL that keyCode is depreciated

    KeyboardEvent.keyCode is depreciated. Because it was inconsistent. Use a the code version instead, it's more readable.

  398. TIL Vue3 has modifiers built in for input forms

    v-model.number="num2" type="text"

  399. TIL a JWT decoder and how it works

    JWT (JSON Web Tokens) are essentially just JSON objects that are hashed. This site decodes them and explains how it works

  400. TIL end all node processing scripts

    killall node - a sure fire way to kill a node.js server that won't stop running.

  401. TIL web dev debugging parameter trick

    You probably shouldn't do this on prod, but you can add debugging mode to allow for specific features. Something like: site.com?debug

  402. TIL the Rule of Three for Refactoring

    The first time you run into a problem, solve it. The second time, just copy it. The third time, then you make that consideration.

  403. TIL that monorepos are so big and can't be used in git

    Git literally cannot handle all that code for those companies. So they rolled out their own. (With blackjack and hookers)

  404. TIL Dan Abramov's 100 things

    100 things from Dan Abramov. This post has a few of my favorites.

  405. TIL competition between developers

    This tribal-fanboy-stanning is silly.

  406. TIL writing modes

    The 'writing-mode' CSS property determines if lines are laid our horizontally, or vertically. The direction is determined by the context of the direction of the content.

  407. TIL the hover media feature

    If you're on a phone or tablet, chances are -- you cannot hover. But if you're on desktop using a mouse -- you can!

  408. TIL map() only when you need it

    The origins of 'map()' was to create methods that allow us to manipulate array data without mutating it. It's part of the whole set of methods to make functional programming easier in Javascript.

  409. TIL A nice way to use calc to get margin space

    I love it when bootstrap containers automatically create padding based on size.

  410. TIL solving the this keyword and it's execution context

    The this keyword references the current execution context of the function from where you’re calling using it. If it's used in a regular function, a arrow function, or a method changes the execution context of this.

  411. TIL Writing really good alt text

    One way to think of alternative text is to think about how you would read the page containing the image to someone over the phone, without mentioning that there is an image present. Whatever you say instead of the image is typically a good start for writing the alternative text.

  412. TIL that it's ::before, not :before

    So what should you be using? Unless you time travel, double-colon.

  413. TIL converting Booleans to Numbers

    This helper is great for APIs. Not every language parses true/false the same. But every language knows that 0 is false, and 1 is true.

  414. TIL Microtask Queue vs the Call Stack Queue

    When everything is done from the 'Call Stack', the Event Loop finds some new tasks to go after. It'll dig through all the 'Microtasks queues', then in the 'Macrotasks queues'.

  415. TIL Layers in CSS

    CSS goes through a lot of passes to determine style orders. Make the css more specific, and it takes priority. Add a '#', and it takes even more priority. Add a freakin' '!important;', and hurray, you're at the top.

  416. TIL Accessibility changes and dynamic content

    Using JavaScript, it is possible to dynamically change parts of a page without requiring the entire page to reload. But the result is that pages with accessibility issues do not return the value.

  417. TIL doing a reverse-search history in bash

    Your bash history is saved with up/down arrow keys. Which means you shouldn't save your passwords on it. But you can use Ctrl+R to open up a search prompt.

  418. TIL of a console.log way to avoid [object object]

    you can use JSON.stringify to get a object.

  419. TIL Rule of Three in Refactoring

    Follow the Rule of Three. It makes it easier to find correct abstractions. Ignore the first. Duplicate the second. Refactor when you see it a third time.

  420. TIL a fancy word for auto-generating objects, A Factory Function

    So a factory function creates objects. That's all.

  421. TIL the Two Types of People and Why Pair Programming works

    The 'Researcher' & the 'Stack Overflower' - Neither is effective in its own isolation, both are necessary to being an engineer, you've done this in the first year of your careers, both of these.

  422. TIL JS Coercion

    In JavaScript, the + operator is used for both numeric addition and string concatenation. When you 'add' a number to a string the interpreter converts your number to a string and concatenates both together.

  423. TIL default template choices in WordPress

    This is a list of template pages that you can add in your custom-theme. It's a really nice feature that WordPress has built-in.

  424. TIL I'm done with FontAwesome

    When I first discovered FontAwesome in 2013, I like everyone thought the same thing -- this is a MAJOR game changer. It is now 2022. As I look back, FontAwesome has become unsustainable.

  425. TIL You can change the blinking line

    The caret-color CSS property sets the color of the insertion caret, the visible marker where the next character typed will be inserted. This is sometimes referred to as the text input cursor.

  426. TIL CSS pseudo-element first-letter, to make a Drop Cap

    You can add a drop cap to a paragraph by using the ::first-letter pseudo-element.

  427. TIL Avoiding dependencies in your helper functions

    Impure functions for helpers? What is this... 1999?

  428. TIL Find unused JavaScript

    Chrome's Coverage panel allows you to quickly locate JavaScript (and CSS) code that has — and has not — been used. To start, open Coverage from the More tools sub-menu in the DevTools menu

  429. TIL Blocks Vs Themes Style responsibility in WordPress

    In WordPress Full-site editing mode - Who manages CSS styles? Blocks or Themes? Well, a bit of both!

  430. TIL Getting parent data from child component

    Sometimes we want to access data from a parent, but don’t want to go through the hassle of passing props.

  431. TIL setTimeout, blocks, closure

    setTimeout is creating a closure function. More importantly, vars get yoinked by closure, where lets create their own block scope.

  432. TIL Declarative Vs Imperative Programming Paradigms

    Declarative Programming is like asking your friend to fix your car. You don’t care how to fix it, that’s up to her. Imperative Programming is like your friend calling your father that tells her how to fix your car step by step.

  433. TIL adding a debug flag for custom features

    Creating your own ?debug flag in your url to do some sweet debug stuff

  434. TIL Casting values to JS booleans

    use the !! to casting values to JS

  435. TIL checking falsy values inside an array

    Using the key Boolean to find any true/false statements inside an array

  436. TIL Adding Tooltips without a library

    You can add tooltips without a library by adding a title attribute in any html element

  437. TIL the Download attribute in links

    href="link/to/your/file" download="filename.pdf" to make your links auto-download

  438. TIL how to turn anything into a editable text

    So you'd use a 'input' or 'textarea' field to create a space for the end user to add new content. Did you know you can also do with that almost any element?

  439. TIL that it's not a pop-up, be more precise

    Teach others to stop using pop-up. It means like 10+ different things.

  440. TIL a neat way to clone and object and override the items

    Spread the object into a new object, then override the element later.

  441. TIL mutations and how to sort without mutating

    Mutation isn't bad. It CAN cause side effects and ruin your life. There's times when you want to have your objects mutate. For everything else, switch to functional programming and passing the data.

  442. TIL You can dynamically name objects

    Not all Object keys have to be hard-coded strings. To make it dynamic, use [brackets].

  443. TIL a clean way to add classes based on the page in Vue

    If your pages exist in a array, use the includes() to check.

  444. TIL that it's normal to feel embarrassed by your code

    If you wait till you’re not embarrassed about your code to show your code, you’ve waited too long.

  445. TIL adding properties conditionally using the spread syntax

    You can conditionally add properties to objects by ... in there.

  446. TIL about Code Golf

    Stop with the code golf. My blood level rises every time I see code that tries to reduce character count.

  447. TIL How to check if the string is uppercase

    The magic is comparing str === str.toUpperCase()

  448. TIL JS commas evaluate operands

    The comma operator evaluates each of its operands (from left to right) and returns the value of the last operand. var a=(2,3,4,5,6,7), result is 7.

  449. TIL when to use SOLID in 2021

    SOLID is an acronym for 5 principles. But they were made when dinosaurs roam the earth.

  450. TIL Technical Debt isn't a problem, it's a tool

    t's a very junior-level thing to assume all technical debt is bad. It's like assuming all debt is bad. Senior devs know how to make trade-offs.

  451. TIL match expression (like switch)

    Use the match($var) method to filter the results to exactly what you want.

  452. TIL how to remove a event listener

    Maybe you have a situation where you only want the event to fire once.

  453. TIL Scribblenauts isn't math, it's hand-crafted

    Most people believed that this impressive system was the result of complicated math, but according to one designer, the real secret was hand-crafting.

  454. TIL Optional Chaining in PHP8

    Optional Chaining in PHP looks very similar to optional chaining in JS

  455. TIL the DOM and CSSOM

    DOM is the html. CSSOM is the design. Together, they become... WEBPAGE-PERSON.

  456. TIL Javascript Vs Typescript cheatsheet

    A easy-to-print sheet pointing out the difference between the two.

  457. TIL Adds days to a date

    Maybe you just need some quick date math, and don't want to use a date library.

  458. TIL the Door Problem

    The door problem is all the questions you have to answer just to get a door in a game. As a frontend developer, the work I do is about turning a mockup into a working website. Door... button... same problem.

  459. TIL how to get a random Hex color

    Math.random()*16777215 then turn it into a

  460. TIL SSG vs SSR vs CSR

    SSG means Static Site Generation. SSR means Server Side Rendering. CSR means Client Side Rendering.

  461. TIL how Wing Commander shipped with a clever hack

    Error when you quit? Change the error message!

  462. TIL Grouping Event Handlers

    Group your event handlers together for that sweet cleaner, fresher code.

  463. TIL Web Component two-up

    I think there's still a world where it can exist. We just have to find a right way to do it.

  464. TIL Pure and Impure Functions

    A important piece of Functional Programming is creating Pure Functions. NO SIDE EFFECTS

  465. TIL that there was a menu element in prior HTML versions

    There was a menu element that we replaced with ul and li elements

  466. TIL all functions create a empty prototype object

    When you create a function in JavaScript, it automatically creates an empty container called prototype for you to stick your methods into.

  467. TIL how to get a list of all globally installed npm commands

    Well, you probably installed it globally. I was curious on what other global commands I installed. 'npm list -g --depth 0'

  468. TIL Value as Number

    Returns the value of the element, interpreted as one of the following, in order: A time value, A number, NaN if conversion is impossible.

  469. TIL difference between document.hidden vs document.hasFocus()

    Do you need to check if the tab is currently active/Visible?

  470. TIL Finds the differences between arrays

    Finds the differences between arrays

  471. TIL oncontextmenu feature for right-clicking

    The oncontextmenu property lets us assign an event handler function when the right mouse button is clicked on the browser tab.

  472. TIL writing cleaner If statements

    Graphs and visual flow of various if-else statements

  473. TIL using Flexbox column-gaps

    Using Column-gaps lets you space things out correctly, AND properly lays out your container elements.

  474. TIL Scroll to the top of the page

    A neat trick to create one of those 'To the top' buttons!

  475. TIL Check if a given element is in focus

    The key ingredient is document.activeElement!

  476. TIL toLocaleDateString that's built into Javascript for dates

    Date().toLocaleDateString('en-US') returns a string with a language sensitive representation of the date portion of this date.

  477. TIL Event Listeners in devtools

    Today I learned that you can identify the Event Listener directly in the Devtools!

  478. TIL lighthouse scores are simulations, not real world

    So if you run Lighthouse on your high-powered developer machine and get great scores, that may not be reflective of what the users experience in the real world, and so what Google will use to measure your website user experience.

  479. TIL what bash means

    Bash means Bourne-again shell. sh was proprietary and not open source, and Bash was created in 1989 to create a free alternative for the GNU project and the Free Software Foundation. Since projects had to pay to use the Bourne shell, Bash became very popular.

  480. TIL about making better presentation slides

    If you're going to have code on your slides, make sure it's the least amount of code necessary to convey the same meaning.The attendees came to listen to you, not to read.

  481. TIL CSS variable tricks

    If you want to change the background with Javascript, you can use a CSS variable.

  482. TIL more about destructuring

    Destructuring allows us to extract values from arrays and objects and store them in variables with a more convenient syntax.

  483. TIL why NodeJS in reference to I/O

    Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. tl;dr: bypasses JavaScript single-threaded event loop

  484. TIL How to actually do CSS Shadows

    A real world shadow has two main distinctive parts. Direct light casts the first shadow and ambient light casts the second.

  485. TIL Netflix' Paved Road

    The Paved Road is a concept in Netflix that allows their teams to use a product or tool that is sort of default for the rest of the company. The product/tool is produced internally and managed internally.

  486. TIL Netflix's method of providing internal tooling at scale

    Netflix had a problem. Before any program can be deployed, it had to run through a rigorous security checklist.

  487. TIL LocalForage, a small js library for caching

    An easy to use library to help with web storage. Switches between localStorage/sessionStorage, and also IndexedDB automagically. 178,000 repos can't be wrong.

  488. TIL hoisting based on function declarations & function expressions

    Function declarations get hoisted on load. So you can use it anywhere. Function expressions do not. Neither are better than another

  489. TIL about Tmux and persistent terminals

    Tmux lets you start a terminal session and then open multiple windows inside that session. Tmux sessions are persistent, which means that programs running in Tmux will continue to run even if you get disconnected.

  490. TIL the Singleton Pattern is hotly debated

    Singleton Pattern is useful when exactly one object is needed to be used as a global instance to coordinate across the system. But it got problems.

  491. TIL The Single Responsibility Principle

    Gather together those things that change for the same reason, and separate those things that change for different reasons... if it makes sense.

  492. TIL being a good teacher

    A good teacher does not teach facts, he or she teaches enthusiasm, open-mindedness and values.

  493. TIL not ignoring errors

    Doing nothing with a caught error doesn't give you the ability to ever fix or react to said error.

  494. TIL how to force-quit in Linux Terminal

    I was goofing off with my raspberry pi and broke something. Then I used ps, and then kill -9 12345 to kill that app.

  495. TIL How to set up Archi Steam Farm on Raspberry Pi

    Archi Steam Farm and a tampermonkey script can auto-farm steam cards then sell them.

  496. TIL KISS (Keep it simple stupid)

    I'm a fan of Keep it Stupidly Simple (KISS) (There's other ways to interpret the the last part).

  497. TIL the value of a good comment

    Inside your code should be explanations about what the code is supposed to be doing. On the other hand, you can go too far in your commenting. Make sure that your comments clarify your code but do not obscure it.

  498. TIL Compound Components in React

    Compound components, where you combine parent/child data.

  499. TIL the difference between throttling and debouncing

    Throttling enforces a maximum number of times a function can be called over time. Debouncing enforces that a function not be called again until a certain amount of time has passed without it being called.

  500. TIL how competitive shooters make maps

    For multiplayer fps games a la counterstrike, use node graphs.

  501. TIL how a dev cut GTA Online load times by 70%

    In all, t0st estimates that 1,984,531,500 checks take place (nearly two billion!), again taking up a ton of CPU time.

  502. TIL about massive re-writes vs write-in-place

    There's two schools of thinking when it comes to rebuilding a project.

  503. TIL How annoying interviews can be

    For web developers, the're a neat parlor trick. Interviews should just do away with them.

  504. TIL how Javascript passes data by value, not by reference

    In JavaScript, primitive types like Number or String are passed by value, not by reference.

  505. TIL rimraf, a rm alternative

    rm is platform specific (and certainly will not work on Windows) and rimraf deals with this for us.

  506. TIL dealing with office politics

    One of the things not talked about often is office politics. Not just about identifying issues with tasks, but also figuring out how to handle issues within coworkers/team dynamics.

  507. TIL How to exit out of a node script

    If you write a node script, you can terminate it by Ctrl+C, or forcing a quit within the script, or using the process.exit()

  508. TIL find() vs filter()

    `find()` method return the first value which match from the collection. `filter()` method returns the match value from the array.

  509. TIL Technical Writing

    The goal of good technical writing is to explain in clear terms what a API is about, or how this piece of software works.

  510. TIL A server malfunction took down a whole MMO permanently

    This screams 'We didn't have source control or code management'.

  511. TIL using code-splitting to improve your First Contentful Paint (FCP) score

    Code splitting is a technique where you send only the necessary modules to the user in the beginning.

  512. TIL that sometimes, simplicity is best

    As developers, we want to write clean code and readable code and functioning code and code that just works.

  513. TIL super keyword in Javascript classes

    the super keyword is mainly used when we want to access a variable, method, or constructor in the base class from the derived class.

  514. TIL how to see if terminal commands exist

    Use the 'command -v' to see if the command exists. For example: '$ command -v git'

  515. TIL using Object.freeze to simulate enums in Javascript

    Enums are useful to assign names to the integral constants which makes a program easy to read and maintain. The keyword 'enum is used to declare an enumeration.

  516. TIL Jitter in audio/video conference calls

    Jitter (network jitter) is when the delay time (ms) of data packet transmissions starts varying. It is not the same thing as latency (delay), which is the time it takes for packets to go from one point to another.

  517. TIL about Constraint Validation API (forms)

    Inputs are pretty powerful. Right out of the box, they can autocomplete, validate data, create minimum/maximum lengths, allow for patterns, and even provide state!

  518. TIL the vitality curve (aka Stack Ranking)

    A vitality curve is a performance management practice that calls for individuals to be ranked or rated against their coworkers.

  519. TIL not using the delete keyword for performance issues

    The delete keyword is used to remove a property from an object. Apparently, there is performance issues with `delete` with V8 Javascript Engine.

  520. TIL Optimizations with closures

    To reduce the number of times a variable gets computed, you can use closures. Closures work by storing references to the outer function’s variables. They do not store the actual value.

  521. TIL the difference of Closures in Javascript vs PHP

    I never knew PHP and Javascript closures were different.

  522. TIL the history of the for, forEach, and for...of loops

    for loop came first. Then forEach. With new iterables, for...of was adopted.

  523. TIL spreading an array into another array

    So to merge an array, use the spread operator. '...' <-- that guy

  524. TIL Mono Repo best practices

    In a monorepo, there's a lot of architectural decisions. One major decision: Do you compile each repo and leave the dist?

  525. TIL Deconstructing Objects

    Rather than create a big list of parameters in your function, pass the whole object and deconstruct it.

  526. TIL the benefits of standup

    Standups are actually useful for keeping an eye on the newbies.

  527. TIL /usr doesn't stand for user, but User System Resources

    This directory contains most commands and executables files, libraries and documentation. In the early days of Unix, it was the directory where the users' home directories were placed

  528. TIL how the old generation of engineers thought about their code

    At it's core, all engineering was about making trade offs between the perfect and the workable.

  529. TIL about some key elements of NestJS

    Controllers, Providers, and Modules OH MY!

  530. TIL an Email Address Regular Expression that 99.99% works

    This is probably the closest we can get to the most perfect regex for validating emails.

  531. TIL ES modules and dynamic imports

    Did you know we can also dynamically load modules based on conditionals? The import(path) returns a promise, it fits great with the async/await syntax.

  532. TIL a clean way to refactor if/else statements

    Not using if-statements gets you closer to the code-as-data concept

  533. TIL that you can chain if/else using ternary conditionals

    Chaining Ternary conditionals are really neat

  534. TIL the Heisenbug

    In computer programming, heisenbug is a classification of an unusual software bug that disappears or alters its behavior when an attempt to isolate it is made.

  535. TIL a one-page guide to a bunch of terminal commands I use frequently

    Developers work in the command line frequently.

  536. TIL functions should only do one thing

    The most important rule of programming is - break your code into tiny bite-sized pieces. That makes it easier to compose, test, and add it.

  537. TIL there's actually a official guide for how HTML is implemented

    Enjoy arguing about HTML standards and realize the MDN isn't cutting it? Well I have a solution.

  538. TIL iframe sandbox attribute

    The iframe HTML element represents a nested browsing context, embedding another HTML page into the current one. There's also a sandbox mode.

  539. TIL Automatic Semicolon Insertion

    JavaScript has a 'automatic semicolon insertion' rule. It happens if any of these three scenarios occur.

  540. TIL about this method to generate infinite Utility Helpers with CSS

    Generating tailwind-like utils.

  541. TIL SmooshGate

    It was a a proposal for a JavaScript language feature called `Array.prototype.flatten`.

  542. TIL what ES modules are

    ES Modules (ESM) is the official, standardize module system to Javascript. What the heck does that mean?

  543. TIL HTML's native hidden attribute

    To hide a DOM element: there's a native HTML attribute called `hidden`.

  544. TIL a easy way to generate a lot of fake numbers

    You need lots of array elements. You got it.

  545. TIL why emojis in JS counts as a length of 2

    Characters are written in UTF-16. Emojis are bigger, and require two characters.

  546. TIL how to convert RGB to HEX to RGB again

    It's all just math! AAAAH!

  547. TIL how big the Internet Archives are

    I don't actually have an answer. But as of a 2021 presentation, they grow by about 5-6 PB per quarter.

  548. TIL why NASA will not be able to have usable spacesuits

    The answers were mostly because the space suits of the past were made in a specific way that we can't replicate without building it from scratch again.

  549. TIL how to make mobile devices vibrate

    The Navigator.vibrate() method pulses the vibration hardware on the device, if such hardware exists.

  550. TIL this bash script

    I share this bash script because it's really easy to read, and a reminder that all langauges are kinda built the same.

  551. TIL check if the URL is valid

    Using the Web API URL to check if a link is valid or not.

  552. TIL mysterious with keyword in Javascript

    There's a lot of ancient Javascript code that you really shouldn't use, like with

  553. TIL when to use local storage vs session storage

    We already have the `local storage`, why would we want to use the `session storage`?

  554. TIL how NOT to loop through arrays

    Don't use foreach for these use cases

  555. TIL how devs can explain what needs to happen

    If we’re attempting to convince someone to try something, we should try to empathize with the people we’re presenting to.

  556. TIL Eliminating duplicate objects

    Using `Set` datatypes can let you do this with no fuss.

  557. TIL combining PHP arrays

    array_merge, array_replace, and the (+) union operator

  558. TIL use JS filter like a pro

    To remove falsy items, we use `.filter()` `(Array.prototype.filter())`

  559. TIL how to check if the value is an array

    If the value is an Array, true is returned; otherwise, false is.

  560. TIL even professionals forget things

    It's nice to be reminded that even the professionals forget basic things.

  561. TIL How to convert a jQuery plugin to Vanilla JS

    To use [Lettering.js](http://letteringjs.com/), which is a reallky neat library, you need to bundle jQuery with it. How about not?

  562. TIL array fill references the same object in memory

    When you use `array.fill` to create inner arrays, it's actually just referencing the same space in memory.

  563. TIL the XOR operator in Javascript

    The operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones).

  564. TIL how to Make a Square with CSS with aspect-ratio

    The first figure is for the top and bottom dimension, the second is for left and right.

  565. TIL How to math the 6 minutes(s) ago without a library

    Sometimes you need something to print a date to '6 minute(s) ago', but don't want to import monster-size libs.

  566. TIL Observer Pattern

    The observer pattern defines a subscriber method, which will update every object that is subscribed to itself, making sure every subscriber gets the latest update.

  567. TIL Singleton pattern

    Singleton is a creational design pattern that restricts class to have only one instance, while also creating a global access point to this instance. It is used when control access to a shared resource is needed.

  568. TIL Labels in Javascript

    The 'labeled' statement can be used with break or continue statements.

  569. TIL prohibit inserting text

    You may want to prevent the user from pasting text copied from somewhere in the input fields by calling its method preventDefault().

  570. TIL Disable pull-to-refresh on mobile

    By default, mobile browsers tend to provide a 'bounce' effect or even a page refresh when the top or bottom of a page (or other scroll area) is reached.

  571. TIL Short circuiting

    Short circuit conditionals for that sweet one-liner

  572. TIL column-count

    Using the column-count property you can break an element's content into a specified number of columns.

  573. TIL the time Silicon Valley thieves stole GPS trackers

    Silicon Valley thieves ade off with $18,000 worth of high-tech equipment – unfortunately for them, about 100 GPS tracking devices were among the items taken.

  574. TIL Safari's one-off problems

    Safari is the new IE when it comes to web development. All the one-offs you will face

  575. TIL how many vendor prefixes are left as of 2021

    Per CSS Tricks, we have about 28 left!

  576. TIL ES2021 - plus(+) operator as an alternative parseInt & parseFloat

    You can use the + operator in front of any numeric string to parse it as a number.

  577. TIL to refresh your Cypress test

    A good solution to clearly separate the tests and stop any application callbacks is to visit a 'neutral' blank page.

  578. TIL about OWASP

    I stumbled upon the Open Web Application Security Project

  579. TIL YANGI principle

    YANGI principle: You aren't gonna need it

  580. TIL an easy way to populate an data array

    Bonus - I just had to do this in PHP as well, so you get TWO languages for the price of one TIL!

  581. TIL Bob who hired chinese developers to fix

    Bob had hired a consulting firm in China, sent the consultants the work assigned to him, and then got out of the way, collecting paychecks the whole time

  582. TIL system light mode and dark mode

    Ever notice on mobile devices or on macs, tabs go from light to dark depending on the time?

  583. TIL Separating purpose and appearance in CSS

    Appearance is how the variable looks. Purpose is the intent of the variable.

  584. TIL Not mutating in pure functions

    Functional Programming relies on pure functions.

  585. TIL Halo 2's smart autoload

    Autosaves were special.

  586. TIL Truncating text with Ellipsis

    You know you get a body of text, but you only want a specific amount to be shown?

  587. TIL Redefining the environment, not the function itself

    I think we all can agree that something smells with this code.

  588. TIL Deallocating memory in Javascript

    Garbage collection is done automatically in JS. But how does it work?

  589. TIL minus minus plus

    Well technically true, don't do this. Ever.

  590. TIL the -s in npm install means silent install

    In other words, including -s (or --silent) in your npm install command means that it will have no output (only a newline)

  591. TIL that Windows 10 has code all the way back to Windows 3.x

    This dev digs real deep to see how far Windows has been re-using UI elements.

  592. TIL Console Log trick if a condition is true

    condition && console.log('it's true')

  593. TIL Getting rid of if/else and switch statements

    Getting rid of if/else and switch statements

  594. TIL about all the times devs broke things

    HBO Intern breaks something. Wholesome.

  595. TIL of Amazon's hiring process

    The rounds within a Amazon Interview

  596. TIL Putting a redundant API key as a backup

    Have a backup API key in your system. If you get a rate limit error, you can switch over to it.

  597. TIL Lexical Scoping

    Lexical scoping describes how a parser resolves variable names when functions are nested.

  598. TIL making Function Factories

    Functions making functions

  599. TIL Using Set and Map

    Differences between Arrays/Set & Objects/Map

  600. TIL flattening arrays

    How to flatten out arrays

  601. TIL How CSS get added into the DOM

    Render Tree is CSSOM + DOM Tree with all the correct stylings

  602. TIL Starting with Yes

    At my previous job, I had the opportunity to work with a really brilliant tech nerd. He was my boss, and he's been in the tech space for over 30+ years, and would frequently remind me of this tip.

  603. TIL thinking in States

    This is a great reminder of how to approach a problem.

  604. TIL Some fun dirty coding tricks in video games (2009 edition)

    This classic gamasutra article from 2009 about some of the hacks developers did to get their game out of the door.

  605. TIL Higher Order functions to reduce loops

    Higher Order Functions like Sum, Map, Filter, Reduce

  606. TIL Avoiding Off-by-one errors and state using Recusion

    Recursion is a function that calls itself.

  607. TIL Stateful and stateless

    An expression in a programming language can be “stateful” or “stateless”.

  608. TIL One-by-one errors

    An off-by-one error is when you expect something to be of value N, but in reality it ends up being `N-1` or `N+1`.

  609. TIL the problem with using Loops

    Loops tend to have some flaws. Instead use Higher Order Functions

  610. TIL HTML elements like Blockquote, datalist, details, meter, & progress

    HTML Elements I forget exist. Blockquote, datalist, details, meter, progress

  611. TIL column gap for newspaper look

    Use `column-count` and `column-gap` to give it that sweet newspaper look.

  612. TIL the definition of various testing types - part 1

    This is probably a part 1 of many, since there's so many different test types out there.

  613. TIL javascript async vs defer

    The order of operations in Async and Defer

  614. TIL Sticky navbars with pure CSS

    Google 'Sticky Header', and you'll get a crapton of tutorials. Here's a vanilla CSS way to do it.

  615. TIL how to update pi-hole on Win10

    Pi-hole is great. It provides adblocking on a network level.

  616. TIL Select boxes should be a last resort

    I've always hated Select boxes (aka Dropdowns)

  617. TIL Postel's Law (and how it sucks)

    Postel's Law... Also known as the Robustness Principle

  618. TIL toxic code language in Job Applications

    We're looking for a Rockstar developer!

  619. TIL Adding your own custom panel in Devtools

    I was always curious how chrome extensions like `React Devtools` or `Vue Devtools` magically pop into the Devtools section.

  620. TIL how to get passwords from Filezilla

    A while back, I needed to get the saved password of a website from FileZilla.

  621. TIL Copy/Paste SVG Icons

    And by inlining the SVG, you make one less call, and it loads faster. heroicons.dev is awesome

  622. TIL Accessible CSS Accordions

    For years, I've been looking to find a CSS accordion that is also accessible.

  623. TIL OS Package Managers

    OSes also have package managers to make your life easier.

  624. TIL the start attribute in lists

    The start attribute in lists

  625. TIL CSS Counter

    CSS has a method to automagically generate numbers and pop it into the element itself.

  626. TIL removing ELSE statements to write clearer code

    Programs are meant to be read by humans and only incidentally for computers to execute. Donald Knuth

  627. TIL outline-offset

    Some sites remove :focus. Those sites suck. They should instead do this:

  628. TIL injecting links when the user wants to print thew ebpage

    A neat code snippet: If the user prints the page (for some reason), links get injected into the print.

  629. TIL AHA programming, like WET and DRY

    AHA ('Avoid Hasty Abstractions')

  630. TIL browsers explicity prevent sharing of cached third-party resources

    The original idea was that you would load resources from a CDN. Doesn't work anymore

  631. TIL globalThis

    `this` doesn't mean the same things depending on environment. Use globalThis

  632. TIL this Responsive Image Generator

    With website optimization, it's better to deliver only the image that the browser size needs. Do that here.

  633. TIL Optional Chaining

    The optional chaining `?.` is to see if the value exists

  634. TIL CSS @Supports Rule

    The CSS @supports rule is a great way to check for a new CSS feature.

  635. TIL planes having to restart to avoid overflow

    Boeing planes generally have overflow happens after >200 days.

  636. TIL CSS target everything but last element using Not

    Target everything but the last item in CSS

  637. TIL how Atari's Pitfall generates over 255 unique rooms

    How it was done was by allowing code to generate the room, rather than mapping the room out and saving the data.

  638. TIL using encoding to shorten letters

    All about that base64

  639. TIL that PHP has an abandoned Gender Library

    This extension, in short, tries to guess the gender of first names.

  640. TIL how fonts draw greyscale

    This may be super esoteric knowledge and could have incredibly limited usecases beyond this post.

  641. TIL When to use Serif vs San-serif

    Serifs are recognized for having small decorative lines added as embellishment. San-Serif is basic.

  642. TIL roman numerals in list elements

    In documentation, you often find roman numeral listings, and I never bothered to figure out how that was done!

  643. TIL the Chocolatey GUI

    Installing software via the command line is a way of life. Btw this GUI is really nice too!

  644. TIL the difference between embed and iframe

    What the heck is a <iframe> and a <embed>

  645. TIL about Mounting/Unmounting without software in Windows 10

    I used to download a virtual CD drive to mount isos. Apparently, it's built into Windows 10!

  646. TIL properly adding files into Vue

    Adding external files into vue methods

  647. TIL how to generate a random color using JS

    Randomize Hex Color

  648. TIL Alt text for images that are important

    Alt text is required if the image is a critical part of the content.

  649. TIL Alt Text for everything else

    alt text for images with captions, that are decorative, part of image sets

  650. TIL Adding Alt text to Supporting Images

    For images not critical to the content but support it, a alt attribute must be present.

  651. TIL Alt text for images that contain text

    Alt text for images that contain text

  652. TIL alt text for logos, the right way

    Putting alt text on logos, the right way

  653. TIL Details element that creates a accordion

    HTML Clickable details element!

  654. TIL CSS Text Stroke

    Making a outline on text, using text-shadow and the new text-stroke.

  655. TIL using images as borders

    Images as a border? Use cases are like pencil borders, or patterns

  656. TIL Creating save file versions and a update path

    Check save version. If less than current version, update the save data.

  657. TIL Overflow:clip

  658. TIL 1999 security preach in Hotmail accounts

    Anyone could read or send email from a Hotmail account

  659. TIL about the insides of SVGs and the text element

    SVGs are like mini-html files!

  660. TIL Immediately Invoked Function Expression

    This is a design pattern where you create a function expression that is immediately executed.

  661. TIL Closure as a backpack

    The Backpack concept is a mental model to think about how closure saves data behind the scenes.

  662. TIL Closures in Private Methods

    Closure in JS: Private data

  663. TIL a Closure example with class-like methods

    Closure in JS: Nesting functions

  664. TIL Javascript Closures

    The answer to var a = add(2)(3); //5

  665. TIL what to do if you're a Win User getting NODE_ENV errors

    Setting NODE_ENV=production before command babel doesn't work on Windows.

  666. TIL gap in CSS

    replacing hacky margin-bottom with gap within CSS

  667. TIL writing-mode

    How to flip text so it's sideways, for international reasons.

  668. TIL using math to pick CSS child elements

    These are some sweet CSS psuedoclass tricks.

  669. TIL Input List with datalist

    datalists and autocomplete features

  670. TIL about the CORS-ANYWHERE project

    I was building a web scrapper for a game using Vue, Axios, and Cheerio.

  671. TIL @extend and it's alternatives

    I learned about `@extend` as a way to grab the styles from a element.

  672. TIL Vendoring

  673. TIL about console.count and console.table

    Some different ways to show data via your console

  674. TIL github1s

    One second to read GitHub code with VS Code.

  675. TIL the Readme Template

    I discovered this readme template from Frontend Masters.

  676. TIL how the documentation guides Javascript

    Essentially, the ECMAScript team makes recommendations. And Javascript engines follow the spec to implement.

  677. TIL about adding Styling to scrollbars

    You can decorate your scrollbars with CSS

  678. TIL output buffering in PHP

    If you are outputting a lot of content in php, use ob_start()

  679. TIL

  680. TIL Server-side rendering vs Static Generation

    Server-side sends a fully rendered page to the client. Client-side, you cannot interact with the site, and instead will need to wait for all of the JS to download, to allow the SPA framework to operate.

  681. TIL Triggering Reflow

    Have you ever been reading an article online when something suddenly changes on the pag

  682. TIL about FAANG's employee tiers

    Facebook/Google Tier system

  683. TIL this one-line script to capitalize the first letter of a word

    Other langauges have this. JS has to do it manually

  684. TIL how to jump to a element within a Vue Component

    You use the $el selector and a scrollIntoView

  685. TIL about the term Jank

    Jank is a term that focuses on how a webpage is performing. It's not about the page load, but how smoothly the page renders.

  686. TIL the 4 steps in rendering a webpage

    A typical browser renders a document in 4 steps: style, layout, paint, and compositing.

  687. TIL randomize Arrays

    A one line helper function to randomize array items.

  688. TIL Clean Pasting

    Clean Paste

  689. TIL Colorfonts

    But what if you could define more than one color per glyph? That's ColorFonts!

  690. TIL i18n

    Internationalization for WordPress

  691. TIL About the first-letter pseudo-element

    There's a `first-letter` pseudo-element.

  692. TIL about WPINC and ABSPATH

    WPINC & ABSPATH -- If this file is called directly, abort.

  693. TIL about ESNext

    ESNext is a name that always indicates the next version of JavaScript. Spoiler.

  694. TIL that you need to v-bind $attrs in Vue

    You have to bind $attrs to multi-root components

  695. TIL Switching to SVG for Icon Fonts

    Icon fonts on the web were fundamentally flawed from the beginning. With full SVG support, let's use that

  696. TIL The Media Engagement Index

    In 2018, Google Chrome changed the way autoplay works by including the Media Engagement Index (MEI)

  697. TIL Scroll Margin for anchor links

    When you use anchor links, it jumps to the content with the assigned ID. But it sucks.

  698. TIL Dashicons - WordPress' Official Icon Font

    WordPress has their own Icon Font.

  699. TIL Copy Text to Clipboard

    The user then copies that data, and pastes it somewhere else.

  700. TIL how to scroll to an element in JS

    The normal HTML way is with an anchor link. But sometimes, you need to do it with JS.

  701. TIL Game Roms and how Games were dumped

    The difference between roms, images, warez, etc

  702. TIL How to connect to your Raspberry pi (home network)

    Connecting to your Raspberry Pi

  703. TIL Combining JS objects together

    tl;dr: use the spread operator

  704. TIL how Monster Rancher generates monsters

    In Monster Rancher, monsters can be generated by inserting any CD into the game system. How does that work?

  705. TIL Categorizing code

    I find myself wanting to refactor everything that doesn't move right. I like this post because it doesn't treat all code blocks as equal.

  706. TIL that you shouldn't use Placeholders as inputs

    Placeholder texts aren't labels.

  707. TIL Bootstrap 5 removing jQuery will reduce about 83kb of loading time

    Bootstrap 5-alpha1 has been officially launched dropping jQuery as a dependency and also removing browser support for Internet Explorer 10 and 11.

  708. TIL Object Destructuring

    Object Destructuring -- something you'll see a lot in React & Vue.

  709. TIL When to use a button versus an "a href" link

    When to use one or the other

  710. TIL the difference between strong and i

    When to use strong vs i

  711. TIL reversing HTML lists

    Today I learned about the reverse attribute

  712. TIL How to Summon WordPress in random PHP files

    How to use WordPress Helper functions outside of WordPress

  713. TIL the Capitalize String shortcut

    JavaScript doesn’t have a function that allows you to capitalize a string

  714. TIL about using wpdb to insert data into the WordPress Database

    using wpdb to insert data into the WordPress Database

  715. TIL thisisunsafe

    If you are not a developer and you stumbled on this tip... you should understand that this is a BAD IDEA.

  716. TIL adding WP_HOME & WP_SITEURL

    You can add WP_HOME and WP_SITEURL to wp-config.php to override your WP database

  717. TIL Deleting Object Properties and Shallow Copy

    Shallow copy objects to safely delete properties

  718. TIL chaining Vue 3 Main.js

    Vue's Main.js file looks slightly different. Here is how to modify it.

  719. TIL about the bullet ::marker

    When you have a list element, you had to hack the css to change bullet items. Not anymore!

  720. TIL about how to quickly add a WP Theme customizer Option

    You can do a lot of theme customization that auto-loads the page with every setting change. It's a really nice feature.

  721. TIL VScode bracket formatting for PHP

    Intelephense -> Format: Braces: k&r

  722. TIL how to get WordPress functions working in VSCode

    Right out of the box, PHP Intelephense Extension for VSCode will give errors for WordPress code. How to fix.

  723. TIL of how to generate ASCII folder structures

    It's common to explain or discuss a file system structure

  724. TIL how to run npm that's inside a child folder

    Running npm scripts on other package.json files inside child folders

  725. TIL how to check if a dom element has a specific class

    How to destructure the classList into an array so you can use include()

  726. TIL As of 2020 -- 88% of the US have 4G or higher mobile speeds

    So those 3g tests are really targetting a small minority.

  727. TIL Waiting for video to load event listeners

    I discovered the Media Events `loadedmetadata, loadeddata, canplay, canplaythrough`

  728. TIL the JS Library Current Device

    Current Device JS Library lets you target specific devices

  729. TIL about testing your android directly with Chrome Devtools

    Web developers have a nice Chrome DevTools to do work in. How about Mobile dev

  730. TIL as of 2021, 1024x width is 2% of the world

    1024x desktop is still a option on Google DevTools.

  731. TIL about styling active/focus together

    Style active and focus at the same time. Some people get to your link or selection by keyboard.

  732. TIL how to use CSS to count things

    Using CSS Counter, counter-reset, and counter-increment.

  733. TIL You can look for elements with specific attributes

    Target elements via CSS with certain attributes

  734. TIL How to target Language

    Target language with CSS

  735. TIL NVM separates global installs

    NVM is awesome

  736. TIL that devtools can test timezones

    How to test timezones

  737. TIL reverting back to master after a wild rabbit hole

    Sometimes, you go off in the deep end with your repo and you want everything back to how it was on master.

  738. TIL Wordpress guesses URLs

    If you write the URL of a page in a WordPress site incorrectly, WordPress will try to guess what page you were trying to access and “fix” your request so that you get the proper page and not a 404 error.

  739. TIL Load Bearing Tomatoes

    Game developer code

  740. TIL using underscores to separate numbers

    using underscores to separate numbers

  741. TIL the html lang affects the screen reader voice

    <html> element's lang attribute tells it which language it is written in.

  742. TIL Disabling the submit buttons is bad

    Disabling the submit buttons is bad

  743. TIL Putting error messages above the field

    Putting error messages above the field

  744. TIL Microcopy

    Password vs Choose Password

  745. TIL localCompare

    Sort with localComapre

  746. TIL You can inject JS functions as Chrome bookmarks

    You can put JS functions into a bookmark that will fire on the webpage you are on.

  747. TIL Cloud9 and pulling down a private repo

    Using a online IDE Cloud9

  748. TIL setting up alias on a Mac

    Setting up alias on a mac

  749. TIL Watching Log Files

    Watching log files is useful for debugging in Powershell

  750. TIL You don't need bootstrap

    Bootstrap is big. Maybe you don't need it

  751. TIL how to center anything in CSS

    How to center anything - a decision tree.

  752. TIL All the Javascript Sandboxes

    You need help? Use a JS sandbox to make their lives easier.

  753. TIL creating files in Powershell

    Powershell Equiv to touch

  754. TIL making data prettier

    Your UI doesn't need to map one-to-one with your data's fields and values.

  755. TIL hide Eleventy Blog

    Filter Eleventy Blog posts to hide draft posts

  756. TIL image maps

    Find the image

  757. TIL function hoisting in JS

    Hoisting is cray

  758. TIL Validation with pure HTML

    Validate without JS

  759. TIL git switch

    No more checkout. Only git switch.

  760. TIL Equality Comparisons for objects

    Crazy comparisons

  761. TIL the Spread Operator

    The spread operator is pretty awesome.

  762. TIL Single Responsibility Principle

    Single Responsibility Principle

  763. TIL the default is the first item

    Select all the html

  764. TIL Loose equality

    Have multiple cursors

  765. TIL not to use === to check for NaN

    Don't use === to check for nan

  766. TIL Exceptions to the === rule

    Exceptions to === rule

  767. TIL Equality in JS

    Why {} === {} is false

  768. TIL VSCode Multi-lines

    Have multiple cursors

  769. TIL Node LTS

    Node only up to the latest version

  770. TIL Finding Header information on any website

    Don't save API keys in your header

  771. TIL what grep means

    What does grep mean

  772. TIL Why gray is darker than darkgray

    Colors you so crazy

  773. TIL How to disable the cache

    remove the cache with this

  774. TIL ask about the most successful person

    Ask this one question

  775. TIL about syncthing

    Sync all the things!

  776. TIL about not calling yourself a programmer

    Advice from Peter Drucker

  777. TIL you can style console logs

    console logs wow

  778. TIL Prettier-ignore

    Ah stop it!

  779. TIL WordPress direct page ID

    WordPress Haxxs!

  780. TIL NPM Audit Fix

    Update your security packs

  781. TIL The Address tag

    JS you so crazy

  782. TIL External links should not be "=_target"

    target=_blank bad for external links

  783. TIL of the Tiger Team Approach

    JS you so crazy

  784. TIL Different Workstations in VSCode

    Work stations

  785. TIL Rest Parameters

    JS you so crazy

  786. TIL that JS has 8 data types

    JS you so crazy

  787. TIL JS's funky decimal math

    JS you so crazy

  788. TIL Aliasing commands in Powershell

    Save time and brain power

  789. TIL Rando.js

    Node Version Manager might be the reason everything's broken in your life.

  790. TIL About Native Lazy Loading

    Native Lazy Loading is a thing!

  791. TIL Github workflows

    Deploy your Github master files to FTP

  792. TIL Static Site Generators

    Easily make websites

  793. TIL Node Version Manager

    Node Version Manager might be the reason everything's broken in your life.

  794. TIL WordPress cache busting

    Importing scripts into WordPress causes it to cache. Cache bust them!

  795. TIL Adding a repo as a dependency in package.js

    If they aren't published as a NPM, you can still do this

  796. TIL Brag Documents

    Record your small wins

  797. TIL The Boyscouts Rule

    Always leave the code you're editing a little better than you found it. - Robert C Martin (Clean Code)

  798. TIL Semantic Syntax

    Version control using Semver

  799. TIL to Reset WP passwords

    Reset WP Passwords

  800. TIL JS Template Literal Shortcuts

    Strings and things!

  801. TIL Golfing

    Recreational programming

  802. TIL Nestling Data in Vue

    Nestled

  803. TIL JS specifics vs JS-looking APIs

    JS specifics vs JS-looking APIs

  804. TIL The Origins of SVN

    JS you so crazy

  805. TIL How to Un-asterisk a password

    Password asterisks!

  806. TIL Default Params in Javascript

    Default Params

  807. TIL Default Params in PHP

    Default Params

  808. TIL Axe for Accessibility

    Be more accessible.

  809. TIL JS Object destructuring

    Object Destructuring

  810. TIL Stop users from copying input

    Functions to stop this

  811. TIL Array Cheatsheet

    Who needs to remember?

  812. TIL Web Speech API

    Have multiple cursors

  813. TIL You may not need WP Plugin

    No need to overload your WordPress

  814. TIL 100vh bug on WebKit (iOS Safari)

    WebKit, iOS Safari is super annoying

  815. TIL About various ways to declare WP Options/Settings Page

    After a lot of research, I found two approaches for writing WP option pages with code.

  816. TIL Box-sizing

    Setting box-sizing to border-box is a neat trick to avoid any unexpected padding issue. It tells the browser to include any border and padding in the values you specify in that element’s width and height itself. For example, if your element width is 125px, then any padding you add will be included in that width(125px) itself.

  817. TIL difference between justify-content vs justify-items

    The 'justify-content' property aligns columns within the container. The 'justify-items' property aligns grid items within their tracks (not the entire container)

  818. TIL Grid Layouts by Jen Simmons

    I absolutely love how Jen Simmons uses Grid to show what can be done. Two completely different usages of grid

  819. TIL applying a filter directly to a background using backdrop-filter

    backdrop-filter applies to everything behind the element, to see the effect you must make the element or its background at least partially transparent.

  820. TIL clip-path and shape-outside

    You know how you can shape a picture into a circle, and then wrap text around it? You can do that with two features.

  821. TIL How to add a placeholder cursor in an input

    How to add a placeholder cursor in an input

  822. TIL about RxJS Observables

    RxJS is a reactive programming library, using Observables which takes in a stream of data and emits multiple bits of data over time. They get 'subscribed' to, and events fire from that.

  823. TIL React - VirtualDom

    Fetch this data

  824. TIL React - SetState

    Fetch this data

  825. TIL JS Symbols

    What are symbols

  826. TIL JS Constructors

    JS you so crazy

  827. TIL JS Objects to Classes

    It's all sugar baby

  828. TIL Hamsters

    Java is to JavaScript as ham is to hamster.” –Jeremy Keith, 2009

  829. TIL fetchJSON

    Fetch this data