- Based on https://gist.github.com/mdziekon/221bdb597cf32b46c50ffab96dbec08a
- Installation date: 16-08-2019
- Additional notes based on my own experience
- EFI boot
- Ubuntu 19.04 -> 21.04
- This should work on any computer. Only the
RAID > AHCIchange described below and the device name for the nvme ssd drive are specific to this laptop. - The process describes a completely fresh installation with complete repartitioning, however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled) as long as Windows already boots with EFI.
- The process was conducted on Dell's XPS 15 9560 (2017) with specs:
- CPU: i7-7700HQ
| export class AppModule { | |
| constructor(private router: Router, private viewportScroller: ViewportScroller) { | |
| // Disable automatic scroll restoration to avoid race conditions | |
| this.viewportScroller.setHistoryScrollRestoration('manual'); | |
| this.handleScrollOnNavigation(); | |
| } | |
| /** | |
| * When route is changed, Angular interprets a simple query params change as "forward navigation" too. |
jsPDF is a low-level library for building PDF files in JavaScript. It does not support multiline text.
Here's a complete helper function based on the answers by @KB1788 and @user3749946 in this StackOverflow thread:
It includes line wrap, page wrap, and some styling control:
| const amqp = require('amqplib'); | |
| const uuid = require('uuid') | |
| const CONSUMER_TAG = uuid.v4(); | |
| const QUEUE_NAME = 'my_queue' | |
| async function main() { | |
| const conn = await amqp.connect('amqp://guest:guest@localhost:5672/%2F'); | |
| const channel = await conn.createChannel(); | |
| await channel.assertQueue(QUEUE_NAME); |
Since Chrome apps are now being deprecated. Download postman from https://dl.pstmn.io/download/latest/linux
Although I highly recommend using a snap
sudo snap install postman
tar -xzf Postman-linux-x64-5.3.2.tar.gz| 'use strict'; | |
| /** | |
| * @callback BeforeShutdownListener | |
| * @param {string} [signalOrEvent] The exit signal or event name received on the process. | |
| */ | |
| /** | |
| * System signals the app will listen to initiate shutdown. | |
| * @const {string[]} |
| // Reference - https://mongoosejs.com/docs/transactions.html | |
| // "mongoose": "^5.11.2" | |
| const assert = require("assert") | |
| const mongoose = require("mongoose") | |
| const case1 = () => { | |
| // Expect Output: | |
| // >>> case 1 catch error error.message | |
| // >>> case1 finally |
The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'instead ofconst foo = require('foo')to import the package. You also need to put"type": "module"in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)from CommonJS instead ofrequire(…). - Stay on the existing version of the package until you can move to ESM.
| require('dotenv').config() | |
| const ftp = require('ftp') | |
| const fs = require('fs') | |
| const { promisify } = require('util') | |
| const env = { | |
| host: process.env.FTP_HOST, | |
| user: process.env.FTP_USER, | |
| password: process.env.FTP_PASS, | |
| folder: process.env.FTP_FOLDER || '/' |
This reference guide shows how to configure a TypeScript Node.js project to work and compile to to native ESM.
CommonJS module system was introduced by the Node.js developers due to the lack of the notion of "modules" in the original JavaScript (ECMAScript) language specification at that time. However, nowadays, ECMAScript has a standard module system called ESM — ECMAScript Modules, which is a part of the accepted standard. This way CommonJS could be considered vendor-specific and obsolete/legacy. Hopefully, TypeScript ecosystem now supports the "new" standard.
So the key benefits are: