NanoDano's blog

How to Build Python from Source

Installing Python is easy using the pre-built installers and packages from your operating system. However, if you want to build the cutting-edge version directly from GitHub master branch, you will have to build your own version from source. You may also want to do it just to reinforce your understanding of Python.

This guide will walk through the steps needed to build Python 3 from source and then create a virtual environment that you can use for projects.

Using Stripe.js Elements with Angular

This will cover a simple example of how to get a credit card payment source token from Stripe that you can use to associate a Stripe customer with a payment source. This is good for subscription services where you need to store the payment source to later add subscriptions to.

We will look at the process for using Stripe.js Elements to create a credit card form that will obtain the token we need.

How to serve Angular locally over HTTPS

Angular has a convenient launcher to serve your app during development (ng serve). It watches for file changes and automatically reloads saving time. By default it serves over HTTP but to avoid issues with mixing HTTP and HTTPS content, you might want to run the local development server using SSL to serve over HTTPS. This will cover how to use ng serve and npm run start to include SSL certificates to use HTTPS.

AJAX HTTP Requests with Vanilla JavaScript

JavaScript in the browser allows you to make asynchronous HTTP requests using AJAX (asynchronous JavaScript and XML). The benefit of making an AJAX call is that it does not require the page to reload, creating an interface that feels smoother and more responsive.

Some frameworks like jQuery make this even easier, but it is important to understand how to do it without a framework.

Let's look at an example of how to do this.

Angular Create Multiple Environment Files

With Angular 7, when you create an app with the default app generator, it creates two basic environment files: development and production.

When you run ng serve it serves with the development environment settings. To build production you run ng build --prod.

My problem was that I wanted more environments, particularly, a local, development, and production environment. So I wanted to add a new settings file for local work and have ng serve use the local settings.

This will look at how to create additional environment settings files, how to use ng build with your custom environment, and how to use ng serve with the custom environments too.

The serve command first calls build, so we will first look at how to update the build step and then the serve action.

Arduino CLI Tutorial

There is an official Arduino CLI application that allows you to compile and upload sketches from the command-line without IDE.

This guide will walk through the process of installing and configuring the CLI tool as well as compiling and uploading sketches. It will also cover third-party boards and libraries like the ESP8266 and Adafruit PyPortal.

Read the official documentation and view the source code at https://github.com/arduino/arduino-cli.

PyPortal CircuitPy Tutorial (AdaBox 011)

The PyPortal is an awesome little IoT device that is programmable with CircuitPython. It's got wi-fi, a color touch screen, a speaker and speaker connector, microSD card slot, 8MB flash memory, a light sensor, a temperature sensor, a NeoPixel LED, a few JST connectors, and more!

You can buy a PyPortal at https://www.adafruit.com/product/4116. This tutorial covers the PyPortal that came in AdaBox011. I don't believe there are any differences between the AdaBox version and the one you can buy separately from the shop.

In this tutorial we will take a look at the various components and how to use them in CircuitPython with code examples for each. After following the tutorial you should have a solid grasp on the PyPortal.

Since the hardware and software is open source, you can find the sources online: