Skip to content

Instantly share code, notes, and snippets.

View riccardosacco's full-sized avatar

Riccardo Sacco riccardosacco

View GitHub Profile
@riccardosacco
riccardosacco / sql_advanded.sql
Last active March 23, 2020 16:07
SQL Advanced
CREATE TABLE `Kingdom` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(90) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
INSERT INTO `Kingdom` VALUES (1,'Logre'),(2,'Caledonie'),(3,'Carmelide'),(4,'Vannes'),(5,'Galles'),(6,'Aquitaine');
CREATE TABLE `Role` (
`id` int(11) NOT NULL AUTO_INCREMENT,

Ultimate Coding Resources List

A collection of the best resources for programming, web development, computer science and more.

DISCLAIMER: it is worth mentioning that a portion of resources (mainly courses and books) included have affiliate links or items mentioned are projects I have built that I directly benefit from their sale or use.

Books

PM2 Cheatsheet

Fork mode

pm2 start app.js --name my-api # Name process

Cluster mode

pm2 start app.js -i 0        # Will start maximum processes with LB depending on available CPUs
pm2 start app.js -i max      # Same as above, but deprecated.
pm2 scale app +3             # Scales `app` up by 3 workers

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $100 of credit for 90 days https://m.do.co/c/b0dd055e441d

2. Create a droplet and log in via ssh

Create an Ubuntu 18.04 droplet and log in via ssh with the credentials sent to your email

@riccardosacco
riccardosacco / History|-10a2c652|entries.json
Last active October 3, 2022 10:05
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/riccardosacco/Downloads/Repositories/hoop-auth0-test/next.config.js","entries":[{"id":"m7Rm.js","timestamp":1657228081008},{"id":"bDK7.js","timestamp":1657722522503},{"id":"XmUS.js","timestamp":1657722533517}]}