Category: Programming

2020-05-20T15:41:28Z

Introduction to JavaScript Promises

The use of callback functions is so common in JavaScript that often you find that in the callback from one asynchronous operation the only option that you have is to start another. In many cases you end up having a long chain of callbacks within callbacks, a situation that has been appropriately referenced as callback hell.

Modern JavaScript has introduced the concept of Promises to better deal with asynchronous notifications and prevent callback hell. In this article I'm going to show how to work with libraries based on promises, how to use promises in your own functions, and how to upgrade callback-based functions to promises.

4 comments

2020-05-12T14:28:01Z

Video: Introduction to Terminal Multiplexing with Tmux

Posted by Miguel Grinberg under Programming.

In this video I demonstrate how I used tmux alongisde vim.

Download my .tmux.conf file if you want something to start experimenting with tmux!

1 comment

2020-05-07T18:00:47Z

Video: Setting Up Vim to Work with Python Applications

In this short video tutorial I demonstrate my Vim editor setup for working with Python applications.

Do you want to try this out? Download my .vimrc file! If your tagbar does not work, install Exuberant Ctags (use brew install ctags or sudo apt-get install ctags, or download from http://ctags.sourceforge.net/)

4 comments

2020-04-09T17:03:54Z

How To Add Flask-Migrate To An Existing Project

A question that I frequently get is how to start tracking database migrations with my Flask-Migrate extension when the project has an established database, making it impossible to delete everything and start over from scratch. In this article and companion video I'm going to show you how to set up Flask-Migrate with zero risk for your current database.

3 comments

2020-03-29T11:22:17Z

How to Deploy a React + Flask Project

Welcome to the second part of my "React + Flask" series. In this episode we are going to deploy our project on a production server!

Have you missed the first part of this tutorial? You can find it here.

26 comments

2020-02-21T11:06:26Z

How To Create a React + Flask Project

One of the questions I get asked more often lately is how to create a project that combines a React frontend with a Flask backend. Instead of giving vague answers I decided to write a tutorial about it, including a video in which I go through the steps to create a simple but fully functional React+Flask project.

55 comments

2019-12-21T18:03:24Z

The Ultimate Guide to Python Decorators, Part III: Decorators with Arguments

This is the third part of my in-depth tutorial on Python decorators. In parts I and II I showed you how to create some useful decorators, but to keep things simple none of the decorator examples you've seen so far accept any arguments. In this installment you will learn how to write decorators that take custom arguments, like any normal Python function.

7 comments

2019-10-31T21:48:36Z

Video: MicroPython Heats My Home

In this video I discuss a little MicroPython based project that I implemented in my home to improve the efficiency of the heating controller.

2019-10-22T15:32:45Z

The Ultimate Guide to Python Decorators, Part II: Altering Function Behavior

Welcome to the second part of my Python decorator series. In the first part I showed you the most basic style of decorators, which are used to register functions as handlers or callbacks for events. In this part I'm going to show you more interesting decorators that alter or complement the behavior of the decorated function.

3 comments

2019-10-14T15:31:25Z

Video: How to Measure Web App Performance

Posted by Miguel Grinberg under Cloud, Programming.

3 comments