https://rafaelcamargo.com/blog/l/en-US/Rafael Camargo2024-03-01T00:12:06ZRafael Camargohttps://rafaelcamargo.com/blog/handling-leading-zeros-with-javascriptHandling leading zeros with JavaScript2024-02-28T00:06:36Z2024-02-28T00:06:36Z
There are countless cases where a leading zero means nothing. It's useless. Its existence is perfectly dispensable. But there are some cases where it is crucial. A common scenario in a programmer's daily life is constructing dates from a standard ISO string. The absence of leading zeros disrespects the standard and, consequently, preve...
https://rafaelcamargo.com/blog/testing-and-implementing-an-in-page-scroll-link-in-reactTesting and implementing an in-page scroll link in React2024-01-30T00:06:56Z2024-01-30T00:06:56Z
One of the most commonly used strategies to allow visitors to navigate through sections of the same page is smooth scrolling. In contrast to the strategy of simply scrolling the page through an anchor added to the URL, which immediately transports the visitor to the desired section, smooth scrolling offers a more fluid experience, guid...
https://rafaelcamargo.com/blog/using-flexbox-to-make-elements-fill-all-the-remaining-spaceUsing flexbox to make elements fill all the remaining space2023-12-20T00:05:13Z2023-12-20T00:05:13Z
When designing a new application view, there are moments when we want an element to completely fill some remaining variable space. For example, consider a form row containing two elements: a search box and a button. Since the width of this form row is fluid, sometimes shorter and other times narrower, how can we ensure that the search ...
https://rafaelcamargo.com/blog/handling-html-within-react-i18next-translationsHandling HTML within React i18next translations2023-11-29T00:05:22Z2023-11-29T00:05:22Z
Supporting multiple languages within the same software can be a huge advantage for companies aiming to conquer markets beyond their own country's borders. One of the most popular JavaScript libraries focused on internationalizing applications is i18next. One of the first questions that may come to mind is: if i18next is the next, what ...
https://rafaelcamargo.com/blog/testing-copy-to-clipboard-interactions-with-jest-and-testing-libraryTesting copy-to-clipboard interactions with Jest and Testing Library2023-10-30T00:05:26Z2023-10-30T00:05:26Z
Long ago, I was amazed by the release of yet another project by Zeno Rocha, one of the most impressive professionals I know. The project was called clipboard.js. Back then, the most common strategy for implementing any button that copied data to the clipboard was to use Flash, a technology that faded away with the advent of HTML 5. Ove...
https://rafaelcamargo.com/blog/mocking-search-params-in-tests-for-react-componentsMocking search params in tests for React components2023-09-23T00:06:04Z2023-09-23T00:06:04Z
Anyone who has needed to ensure that a React component behaves correctly based on parameters passed in the URL has likely faced some level of difficulty with testing. One of the initial strategies used to simulate this use case is attempting to set search params in the URL before the component mounts. Something like: However, by applyi...
https://rafaelcamargo.com/blog/handling-indentation-in-testing-library-assertionsHandling indentation in Testing Library assertions2023-08-29T00:05:10Z2023-08-29T00:05:10Z
About two months ago, while implementing Bordiple, an unprecedented situation arose as I was writing an automated test. Since one of Bordiple's goals is to make front-end development a little easier, CSS code is automatically generated at the time borders are set via graphic interface. CSS code automatically generated by Bordiple The a...
https://rafaelcamargo.com/blog/google-analytics-is-over-at-least-for-meGoogle Analytics is over, at least for me.2023-07-28T00:04:33Z2023-07-28T00:04:33Z
It was mid-2020 when I first heard about Plausible. That was a tweet by Jason Fried sharing the pros of the service, a web analytics tool. Jason highlighted Plausible's privacy-first approach to track the usage of a website. Unlike Google Analytics, Plausible doesn't use cookies e doesn't track people across their devices and across we...
https://rafaelcamargo.com/blog/bordiple-is-a-css-multiple-borders-generatorBordiple is a CSS multiple borders generator2023-06-28T00:04:18Z2023-06-28T00:04:18Z
At the moment I finished to write my last post about elements with multiple borders using pure CSS, I kept wondering how productive it would be if there were an online tool that aid programmers and designers to create and visualize multiple borders elements. Since I haven't found any, I decided to create Bordiple. Preview and share you...
https://rafaelcamargo.com/blog/elements-with-multiple-borders-using-pure-cssElements with multiple borders using pure CSS2023-05-28T00:05:47Z2023-05-28T00:05:47Z
Even though CSS is extremely powerful, some visual results may be impossible to achieve by using the language in its usual way, which demands a certain degree of creativity from developers at the moment they are writing their stylesheets. Setting multiple borders to an element is a perfect example of those cases. How good it'd be if we...