RSSAmplifier

Blog

Gustavo Straube

Software development and beyond

gustavostraube.wordpress.comRSS feed ↗10 posts

Latest posts

Operator overloading in Python and ORMs

If you worked with ORMs in Python such as SQLAlchemy or Django ORM, you probably saw or wrote code like this when dealing with queries: This is something that bothered me when I first saw it. Coming from languages like PHP and JavaScript, that equality operation as a function argument doesn t make a lot of Continue reading "Operator overloading in Python and ORMs"

It’s been a while…

since the last time I wrote here, 3 years ago. And a lot has changed. Back then, I was still doing some PHP, but slowly shifting toward a fully JavaScript/TypeScript stack, working with Node.js and Edge Functions on the backend, and React and Next.js on the frontend. Then, at the end of October 2023, Continue reading "It s been a while "

A PHP engineer working with Node.js

Most of the software projects I engaged in during my career had PHP as their main programming language. Yet, I also had the opportunity to work with other stacks. One of these times I developed the backend of a waterway monitoring app using Node.js. The main purpose of the app was to provide relevant data Continue reading "A PHP engineer working with Node.js"

Installing Composer v1 in a CircleCI build

Composer v2 has been released for a while now, however some older projects still might rely on its previous major version. When using the official images from CircleCI to build a project, you ll probably get the latest version of Composer installed. If that s causing a build to break, it s possible to downgrade Composer by adding Continue reading "Installing Composer v1 in a CircleCI build"

Add Bootstrap styles to a project without Webpack

The directions below are not only applicable to Bootstrap but to any SASS-based framework or library. Introduction I started working on a small project that compiles to a small set of static HTML+CSS. Since I don t have any Javascript in it, using Webpack didn t look the right way to include the Bootstrap files I wanted. Continue reading "Add Bootstrap styles to a project without Webpack"

Avoiding state update on unmounted React component within useEffect hook

The hooks introduced with React 16.8 are a nice way to control state and other features on functional React components. They discard the necessity of third-party libraries such as Recompose – which is the inspiration for React hooks, by the way. One way one can apply the useEffect hook, for example, is to mimic the Continue reading "Avoiding state update on unmounted React component within…

Custom setters with React useState hook

One of the recent additions to React was its hooks. With that, developers don t need to rely on libraries such as Recompose to add state (and other features) to functional components. If you re one of those devs and were used to create custom setters for states, it s possible you find the new useState hook somewhat Continue reading "Custom setters with React useState hook"

Checking DNS records of a specific nameserver

I m migrating a site from GoDaddy to HostGator (I personally would prefer to move over AWS but that s the client s choice in this specific case) and I wanted to get the IP of the new server on HostGator. I couldn t find the IP anywhere on their control panel. Pinging the temporary URL they provide for Continue reading "Checking DNS records of a specific nameserver"

Laravel and NodeJS messaging using Redis Pub/Sub

I was recently working on this project that was composed of two different parts: a web application built in PHP with Laravel, and an AWS Lambda function written in NodeJS. In the past, both applications exchanged data using a common MySQL database. With time, this setup showed up very inefficient. As the number of messages sent and Continue reading "Laravel and NodeJS messaging using Redis…

Using MutationObserver API and undo.js to track DOM changes

I was recently working on this project that had a kind of drag and drop builder. Users should be able to drag items into a specific building area to assembly stuff — I m sorry for not giving more details, by the time I m writing this the product is not yet released. One of the features I Continue reading "Using MutationObserver API and undo.js to track DOM changes"