Do Repeated string literals in the JavaSript codebase increase the final file size? Yes, they do. Does it matter? Not for the backend applications, but for frontend applications – and anything that contributes towards them – it does. For example, npm packages and directly loaded scripts, server-side rendered web applications, and SPAs such as Angular, React, and Vue.[Read More]
Remove Whitespaces Between Markdown Markers
To fix Bold, Italic, and Strikethrough tags.
Markdown spec outlines markers, such as the asterisk (
*), underscore (
_), and double tilde (
~~), for bold, italic and
strikethrough, (or otherwise known as strong, emphasis, and delete), but requires these markers to wrap the text content on left and right without any whitespace(s). Any space on either side makes the markers appear as is instead of valid HTML tags after parsing/translation.
Multiple Ways to Build APIs to Use Airtable Data in Applications
With their advantages and disadvantages
Helper methods to tell if the case of the string is camel, snake, kebab, upper, lower, or start.
Instead of writing our own logic to determine if the given string is of a particular case or not, we can write a helper method that acts as a wrapper, in which we compare the original string with the one returned by lodash method, and return true or false. The wrapper is a good way to pass on the responsibility of correct logic to lodash, a thoroughly tested library.[Read More]
Change the case of object keys recursively to camel, snake, kebab, upper, lower, and start. Or modify in another way.
For a deeply nested object or array of objects, we might want to replace all the keys in some way, such as modifying their case (camel case, snake case, etc.) or adding an underscore at the start of each key or on both sides. Or we may like to change the keys in any other way.[Read More]
A browser firewall without any backend!
And show personalized content on browser based on data
With the help of the browser’s LocalStorage, we can keep track of the number of visits of a user on the website or a particular webpage. Based on this data, customized alerts, messages or information can be shown to the user.[Read More]
React JS Render Form With Dynamic Conditional Fields
Show or hide based on the parent field value
React JS Render Form With Dynamic Data From Backend API
including field validations
We need to plot a form whose entire fields are coming from the backend. Since the fields are not known in advance, we cannot add them statically. The data about each field, such as its id to save with, name, validations, etc. all comes in the API response too.
For the given scenario, I have used React Hook Form. The demo and example code for a dynamic questionnaire is shared below.[Read More]