Skip to main content

9 posts tagged with "javascript"

View all tags

TensorFlow.js — Running AI Directly in the Browser

· 8 min read
Bruno Carneiro
Fundador da @TautornTech

Machine learning always seemed distant from frontend — Python, powerful servers, expensive GPUs. But that changed. Today it's possible to run a trained AI model directly in the browser, with zero backend, using pure JavaScript and the user's own GPU.

This article explains how this works in practice, using TensorFlow.js as a foundation — and how I applied it in a project called SeeFood, a classifier that solves humanity's greatest problem: knowing whether what you're about to eat is a hot dog or not.

Detecting Circular Imports with Madge (and Locking Down Regressions in Lint)

· 9 min read
Bruno Carneiro
Fundador da @TautornTech
Illustrative diagram of an import cycle between TypeScript modules

Anyone who has spent hours chasing an undefined in the middle of a bundle or a strange behavior only in production knows how an unresolved import chain can become a headache. One of the frequent culprits is the circular import: module A imports B, B imports C, and somewhere in the chain someone imports A again — closing a cycle.

It's wonderful — the build works, the project runs locally, but when you try to deploy, it breaks! \o/

I've seen this in small projects and in large ones; the only difference is the size of the problem you'll face. You can spot the headache with Madge and it's a lifesaver!

To lock up TypeScript, a circular import is a treat.

Clean Code JavaScript

· 10 min read
Bruno Carneiro
Fundador da @TautornTech

In this article, I will present some good programming practices in JavaScript. However, these practices can be applied to any programming language, as they represent a set of recommended guidelines.

The central concept addressed here is "Clean Code," which refers to code that is easy to read and understand, as well as easy to maintain. The goal is to create clear and concise code.

Before proceeding, I would like to start with a quote from Bjarne Stroustrup, the creator of the C++ language:

"I like my code to be elegant and efficient. The logic should be straightforward to make it hard for bugs to hide, the dependencies minimal to ease maintenance, error handling complete according to an articulated strategy, and performance close to optimal so as not to tempt people to make the code messy with unprincipled optimizations. Clean code does one thing well."