# Tutorials

**URL:** https://forum.codeselfstudy.com/c/tutorials/43.md

[Latest](https://forum.codeselfstudy.com/latest.md) · [Categories](https://forum.codeselfstudy.com/categories.md) · [Tags](https://forum.codeselfstudy.com/tags.md)

---

## [About the Tutorials category](https://forum.codeselfstudy.com/t/about-the-tutorials-category/2208)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 0

</div>

This is an experimental section where people can write tutorials to share their knowledge.

---

## [\[Tutorial\] Quickstart a React Site and Blog with GatsbyJS](https://forum.codeselfstudy.com/t/tutorial-quickstart-a-react-site-and-blog-with-gatsbyjs/2214)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 33\
**Last updated:** [November 9, 2022, 1:30am UTC](https://forum.codeselfstudy.com/t/tutorial-quickstart-a-react-site-and-blog-with-gatsbyjs/2214 "2022-11-09T01:30:42Z")

</div>

Update: this tutorial is probably outdated. See the official Gatsby quickstart for current information. This is a quick tutorial about how to quickly build and deploy sites using GatsbyJS. It’s designed for people who k…

---

## [\[Tutorial\] An Introduction to Node.js Servers (and Express.js)](https://forum.codeselfstudy.com/t/tutorial-an-introduction-to-node-js-servers-and-express-js/2211)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 81\
**Last updated:** [February 17, 2022, 6:35pm UTC](https://forum.codeselfstudy.com/t/tutorial-an-introduction-to-node-js-servers-and-express-js/2211 "2022-02-17T18:35:34Z")

</div>

I’m going to try to write some tutorials that answer questions that sometimes come up at meetups. I don’t know if this information is too dense or not useful enough, but feedback is welcome and I’ll keep trying to adju…

---

## [How to get a Javascript Date formatted in Local Time to select from a MySQL timestamp](https://forum.codeselfstudy.com/t/how-to-get-a-javascript-date-formatted-in-local-time-to-select-from-a-mysql-timestamp/2761)

<div class="topic-metadata">

**Author:** [@PaulH](https://forum.codeselfstudy.com/u/PaulH)\
**Replies:** 0\
**Last updated:** [December 1, 2021, 9:31pm UTC](https://forum.codeselfstudy.com/t/how-to-get-a-javascript-date-formatted-in-local-time-to-select-from-a-mysql-timestamp/2761 "2021-12-01T21:31:23Z")

</div>

Javascript has a troublesome date API. Most of the prebuilt functions like .getMonth() work only for ISO (International Standard Time) Dates. Making local time zones a problem. My MySQL table stores the time stamp in t…

---

## [\[Tutorial\] How to Send Transactional Emails with Node.js](https://forum.codeselfstudy.com/t/tutorial-how-to-send-transactional-emails-with-node-js/2262)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 5\
**Last updated:** [June 28, 2021, 7:45pm UTC](https://forum.codeselfstudy.com/t/tutorial-how-to-send-transactional-emails-with-node-js/2262 "2021-06-28T19:45:04Z")

</div>

This is a quick tutorial on how to send emails with Node.js and Mailgun. The general instructions are similar for any transactional email provider. A transactional email service sends emails for you and bills you a smal…

---

## [Notes On Joins and Many to Many SQL Tables - How to store complex SQL tables - Relational Tables 101](https://forum.codeselfstudy.com/t/notes-on-joins-and-many-to-many-sql-tables-how-to-store-complex-sql-tables-relational-tables-101/2654)

<div class="topic-metadata">

**Author:** [@PaulH](https://forum.codeselfstudy.com/u/PaulH)\
**Replies:** 0\
**Last updated:** [June 4, 2021, 5:14am UTC](https://forum.codeselfstudy.com/t/notes-on-joins-and-many-to-many-sql-tables-how-to-store-complex-sql-tables-relational-tables-101/2654 "2021-06-04T05:14:51Z")

</div>

I have been using SQL for years, but I always used it as an excel table. The real power lies in relational tables with ids that link. This means having a shared id between tables. Why do this? It reduces data repetiti…

---

## [How to make HTTP requests in Raku (Perl 6)](https://forum.codeselfstudy.com/t/how-to-make-http-requests-in-raku-perl-6/2518)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 0\
**Last updated:** [November 25, 2020, 8:53am UTC](https://forum.codeselfstudy.com/t/how-to-make-http-requests-in-raku-perl-6/2518 "2020-11-25T08:53:25Z")

</div>

It took me a little while to figure out how to make web requests in Raku, because there weren’t any immediate answers in the search results. Here are some notes in case anyone else is searching. I’m just getting started…

---

## [How to use JSON in Raku](https://forum.codeselfstudy.com/t/how-to-use-json-in-raku/2519)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 0\
**Last updated:** [November 25, 2020, 9:05am UTC](https://forum.codeselfstudy.com/t/how-to-use-json-in-raku/2519 "2020-11-25T09:05:34Z")

</div>

Google’s search results are missing an easy to find quickstart on how to deal with JSON in Raku (Perl 6), so I thought I would write a page for it. First, install JSON::Tiny with the package manager: $ zef install JSON…

---

## [How to open multiple webpages in a browser automatically](https://forum.codeselfstudy.com/t/how-to-open-multiple-webpages-in-a-browser-automatically/2444)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 1\
**Last updated:** [October 16, 2020, 9:03pm UTC](https://forum.codeselfstudy.com/t/how-to-open-multiple-webpages-in-a-browser-automatically/2444 "2020-10-16T21:03:15Z")

</div>

Someone asked a question about how to open multiple web pages in browser tabs at once. I’ll post an answer here in case anyone else is searching for the answer online. This method will work on Linux and Mac, and possibl…

---

## [Make File to Export, Truncate, and Insert (Merge) SQL data from Remote Server to Local](https://forum.codeselfstudy.com/t/make-file-to-export-truncate-and-insert-merge-sql-data-from-remote-server-to-local/2443)

<div class="topic-metadata">

**Author:** [@PaulH](https://forum.codeselfstudy.com/u/PaulH)\
**Replies:** 2\
**Last updated:** [October 16, 2020, 9:02pm UTC](https://forum.codeselfstudy.com/t/make-file-to-export-truncate-and-insert-merge-sql-data-from-remote-server-to-local/2443 "2020-10-16T21:02:25Z")

</div>

I had an issue recently where I need to download activity and feedback data from the remote server. The tables were getting quite large ~500MB so I needed way to truncate them and insert them to a local version. From the…

---

## [How to Export Data from Dynamo DB](https://forum.codeselfstudy.com/t/how-to-export-data-from-dynamo-db/2412)

<div class="topic-metadata">

**Author:** [@PaulH](https://forum.codeselfstudy.com/u/PaulH)\
**Replies:** 0\
**Last updated:** [August 19, 2020, 4:32am UTC](https://forum.codeselfstudy.com/t/how-to-export-data-from-dynamo-db/2412 "2020-08-19T04:32:55Z")

</div>

Do you use Dynamo DB with Amazon (AWS) and are looking for a way to quickly export all your Dynamo data to use in local development? Or maybe to migrate to another system. AWS only lets you export 100 rows to csv in the…

---

## [\[Tutorial\] How to use subdomains in Express.js with vhost](https://forum.codeselfstudy.com/t/tutorial-how-to-use-subdomains-in-express-js-with-vhost/2290)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 6\
**Last updated:** [August 16, 2020, 11:01pm UTC](https://forum.codeselfstudy.com/t/tutorial-how-to-use-subdomains-in-express-js-with-vhost/2290 "2020-08-16T23:01:48Z")

</div>

This quick tutorial shows how to use subdomains with Express.js. If you don’t know Express.js yet, check out some of the previous tutorials, like the introduction to Node.js/Express servers tutorial. Create a simple Exp…

---

## [Web Scraping in the JavaScript Web Console](https://forum.codeselfstudy.com/t/web-scraping-in-the-javascript-web-console/2376)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 1\
**Last updated:** [July 5, 2020, 8:15am UTC](https://forum.codeselfstudy.com/t/web-scraping-in-the-javascript-web-console/2376 "2020-07-05T08:15:31Z")

</div>

I sometimes write little web scrapers in the Firefox web console to extract data from web pages. It saves me a lot of time, and they are fun to write. You can extract data into many formats: CSV, plain text, HTML, or any…

---

## [How to get the classname index with event delegation in javascript](https://forum.codeselfstudy.com/t/how-to-get-the-classname-index-with-event-delegation-in-javascript/2337)

<div class="topic-metadata">

**Author:** [@PaulH](https://forum.codeselfstudy.com/u/PaulH)\
**Replies:** 2\
**Last updated:** [June 15, 2020, 11:20pm UTC](https://forum.codeselfstudy.com/t/how-to-get-the-classname-index-with-event-delegation-in-javascript/2337 "2020-06-15T23:20:27Z")

</div>

Let’s say you are using vanilla javascript and you want to create a list of items that will update dynamically. How do you listen for new items that are added to the DOM. And further, how can you get the index of that i…

---

## [\[Tutorial\] How to Install Node.js on Linux, Mac, and Windows](https://forum.codeselfstudy.com/t/tutorial-how-to-install-node-js-on-linux-mac-and-windows/2231)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 0\
**Last updated:** [April 16, 2020, 12:05am UTC](https://forum.codeselfstudy.com/t/tutorial-how-to-install-node-js-on-linux-mac-and-windows/2231 "2020-04-16T00:05:18Z")

</div>

I’m going to reference installing Node.js from a few tutorials, so I’ll put the installation instructions here. If other people have tips on installing Node, leave a comment below. Step 1: See if Node is already install…

---

## [How to Make Your Own Node Modules to Share Code Between the Client and the Server in Javascript](https://forum.codeselfstudy.com/t/how-to-make-your-own-node-modules-to-share-code-between-the-client-and-the-server-in-javascript/2321)

<div class="topic-metadata">

**Author:** [@PaulH](https://forum.codeselfstudy.com/u/PaulH)\
**Replies:** 14\
**Last updated:** [May 25, 2020, 7:22pm UTC](https://forum.codeselfstudy.com/t/how-to-make-your-own-node-modules-to-share-code-between-the-client-and-the-server-in-javascript/2321 "2020-05-25T19:22:00Z")

</div>

This is a tutorial for people wanting to share javascript code between the sever and the front end. This is useful in cases where your site loads server side but then performs similar actions client side. One way to do…

---

## [A client side routing work around for Vanilla JS web apps](https://forum.codeselfstudy.com/t/a-client-side-routing-work-around-for-vanilla-js-web-apps/2310)

<div class="topic-metadata">

**Author:** [@PaulH](https://forum.codeselfstudy.com/u/PaulH)\
**Replies:** 1\
**Last updated:** [May 14, 2020, 5:18pm UTC](https://forum.codeselfstudy.com/t/a-client-side-routing-work-around-for-vanilla-js-web-apps/2310 "2020-05-14T17:18:14Z")

</div>

To build client-side routing you need to understand both the popstate and pushstate functions. https://developer.mozilla.org/en-US/docs/Web/API/History/pushState https://developer.mozilla.org/en-US/docs/Web/API/Window/…

---

## [How to Switch the Page Down and End key in Ubuntu Linux XFCE](https://forum.codeselfstudy.com/t/how-to-switch-the-page-down-and-end-key-in-ubuntu-linux-xfce/2306)

<div class="topic-metadata">

**Author:** [@PaulH](https://forum.codeselfstudy.com/u/PaulH)\
**Replies:** 4\
**Last updated:** [May 10, 2020, 9:54pm UTC](https://forum.codeselfstudy.com/t/how-to-switch-the-page-down-and-end-key-in-ubuntu-linux-xfce/2306 "2020-05-10T21:54:57Z")

</div>

Open up a new terminal window Enter sudo nano /usr/share/X11/xkb/symbols/pc Enter your admin password if asked. This will bring up a page where you can edit and change many keybindings for Linux. The keys are o…

---

## [\[Tutorial\] How to Use MySQL or MariaDB with Node.js and Express](https://forum.codeselfstudy.com/t/tutorial-how-to-use-mysql-or-mariadb-with-node-js-and-express/2260)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 37\
**Last updated:** [May 5, 2020, 8:37pm UTC](https://forum.codeselfstudy.com/t/tutorial-how-to-use-mysql-or-mariadb-with-node-js-and-express/2260 "2020-05-05T20:37:56Z")

</div>

Following up on the tutorial on Node/Express servers, this tutorial shows how to connect to MySQL (or MariaDB) with Node.js and Express. This tutorial assumes that you already know how to create and connect to a MySQL (…

---

## [\[Tutorial\] An Introduction to JavaScript Components](https://forum.codeselfstudy.com/t/tutorial-an-introduction-to-javascript-components/2209)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 2\
**Last updated:** [May 3, 2020, 11:14pm UTC](https://forum.codeselfstudy.com/t/tutorial-an-introduction-to-javascript-components/2209 "2020-05-03T23:14:49Z")

</div>

This tutorial is an attempt to explain what “components” are in JavaScript frameworks like React and Vue. I tried for a few weeks to make a video version of this, but there were too many errors in the recordings so I’m w…

---

## [\[Tutorial\] JavaScript Destructuring](https://forum.codeselfstudy.com/t/tutorial-javascript-destructuring/2266)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 0\
**Last updated:** [April 27, 2020, 9:48pm UTC](https://forum.codeselfstudy.com/t/tutorial-javascript-destructuring/2266 "2020-04-27T21:48:37Z")

</div>

Here’s a quick explanation about how destructuring works in JavaScript. I’m going to use it in some future tutorials, so I’ll point those tutorials at this explanation. The explanation is written in the comments here: /…

---

## [\[Tutorial\] What is the difference between JSON and JavaScript Objects](https://forum.codeselfstudy.com/t/tutorial-what-is-the-difference-between-json-and-javascript-objects/2267)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 0\
**Last updated:** [April 27, 2020, 10:13pm UTC](https://forum.codeselfstudy.com/t/tutorial-what-is-the-difference-between-json-and-javascript-objects/2267 "2020-04-27T22:13:47Z")

</div>

Here’s a quick explanation of some differences between JavaScript objects and JSON. JavaScript Objects A JavaScript object is a collection of key-value pairs that looks like this: const hobbit = { name: "Frodo", …

---

## [Netlify CLI Quickstart](https://forum.codeselfstudy.com/t/netlify-cli-quickstart/1210)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 0\
**Last updated:** [November 28, 2018, 6:43pm UTC](https://forum.codeselfstudy.com/t/netlify-cli-quickstart/1210 "2018-11-28T18:43:47Z")

</div>

Netlify is a service where you can deploy static sites (HTML/CSS/JS) for free. Here are steps on how to get started. First, be sure that node.js is installed. (nvm is a good way to install node.) Create an account on Ne…
