🔧 Make your Swagger configuration files dynamic using Node.js

/ Software Development / Videos

I got the idea for this article after solving this problem for the team I was working with, for a client. So, what’s the problem? After wrapping up work on a Swagger configuration file, and successfully generating a client JavaScript library to consume the API, we ended up with the following problem: how do we make sure that we’re able to generate the client library and use the proper environment URL, so that we don’t end up calling UAT endpoints from production, or the other way around.

Read more →

How I built a product that failed and won

It was almost a year ago that I started building a self-destructing tweets app, just like Snapchat’s snaps… … and nobody used it. The not-so-short intro In 2017 I set out to create a self-destructing tweets application. Nothing impressive but it helped me learn a lot of things. First, I set out to design it all by myself — failed miserably. At that point I reluctantly decided that the best thing to do is to use a ready-made theme.

Read more →

How to test Node.js modules installed from NPM locally

/ Videos / JavaScript

I’m surprised by the number of people who think you can install modules from npm only in your project’s folder, and only if you have package.json. This is why I decided to create a short video describing my way of testing modules from NPM before bringing them into my application, without having to wait for livereload, builds and other tools to run, before I can see some relevant output. Enjoy!

Read more →

How to get the real type of any JavaScript variable

/ Videos / JavaScript

This weekend I published a short article talking about how to create a CSV using template strings in Node.js. I posted the link on Reddit and a couple of more places and the general feedback was something along the lines of “great article but the most interesting part is that type checking thing”. I decided to record a short screencast, this morning, to detail how that code works and what you could use that function for.

Read more →

Why do data scientists use Sklearn's StandardScaler and what does it do?

/ Machine Learning / JavaScript

Been doing some Machine Learning “learning” in the past two weeks. I’m interested in learning to use TensorFlow.js at a decent level and solve a personal problem — software estimation and road-mapping, for the teams I work with. This has led me down the darkest alleys of Machine Learning blogs. Most of the relevant material I found uses TensorFlow but with Python. I understand why data scientists choose Python over other languages.

Read more →

How to create a CSV using template strings in Node.js

I recently had to create a CSV from some data returned by the Jira API. Went on the Internets to find a module on NPM that would do the job. Unfortunately, I wasn’t able to find a single module that would perform only that simple task. We were already using a module to generate Excel exports, inside the application, but it was generating XLSX files. It also looked like it has a funky license, so I decided to drop it altogether.

Read more →

What is your story of going from zero to hero and changing your life completely in the face of failure?

/ Opinion

I saw an answer request for the following question, on Quora. What is your story of going from zero to hero, and changing your life completely in the face of faliure? I though about it for a while. It seemed shallow. Someone was looking for nice stories to feed their procrastinating, motivation-searching, lazy ego. Then I thought some more. I remembered something Jordan Peterson mentioned, related to Carl Jung : If you can’t figure out a person’s motivations from the conversation, look at the outcome and infer their motivations.

Read more →

Be a good citizen, write code for humans.

/ Software Development

You write code everyday. You’d be forgiven for assuming you write code for yourself. At the end of the day you’re the one who’s going to deliver that task. Why not implement it to your liking? It’s all about you, right?! Well, not quite! Because you won’t be the only one working on that project. Even if that is the case, you won’t be the same person, 3 months from now, when you will touch that feature again for an enhancement.

Read more →

Quick checkout and rebase in Git

/ Git

Here are two simple versions of the checkout and rebase subcommands I use to perform faster branch updates and merges. Check out the last visited branch git checkout - This command is useful if, let’s say, for example, you were on master and you checked out to a new feature branch. You work on the feature and once you’re done, you want to switch back to master, get remote changes and then pull them in your feature branch as well, so you have the latest changes and check for any integration conflicts with other people’s work.

Read more →

Reading BigInt in Chrome, how to handle big numbers in JavaScript & CSS architecture

/ Reading list

Numerous battles have been carried out by developers with JavaScript’s Math. Today, I found some big news on the web, about BigInt landing in V8. Mathias Bynens — BigInt: arbitrary-precision integers in JavaScript Adding BigInts to V8 Source Code — v8/src/objects/bigint.h It’s not going to rid us of BigNumber.js just yet, but it’s probably going to serve as the starting point for implementing BigDecimal. Currently, there are a dozen variants to handle big numbers in JavaScript without touching Math, ranging from keeping the numbers as strings to keeping the integer part and the fraction as separate strings in an array and join them together at a later time to using third party libraries which more or less use the same strategies I mentioned before.

Read more →
Copyright (c) 2023 Adrian Oprea. All rights reserved.