In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and
returning the cached result when the same
inputs occur again.
— wikipedia
| const AWS = require('aws-sdk') | |
| AWS.config.region = process.env.AWS_REGION | |
| const iotdata = new AWS.IotData({ | |
| endpoint: process.env.MQTT_BROKER_ENDPOINT, | |
| accessKeyId: process.env.ACCESS_KEY_ID, | |
| secretAccessKey: process.env.SECRET_ACCESS_KEY | |
| }) |
| #!/usr/bin/env python3 | |
| # See https://github.com/facebook/flipper/issues/262 | |
| import os | |
| import sys | |
| import syslog | |
| import shlex | |
| import time | |
| import subprocess |
This post was adapted from an earlier Twitter thread.
It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.
It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)
And then there's Rollup, which apparently requires ESM to be u
This is pretty out of date now... you may want to look elsewhere
Newer guides than mine (mine is a bit dated and has a lot of rough edges):
Have you looked at these?
Modified WhittlesJr's forked version to prevent some devices from loading its drivers. In my case, NVIDIA's USB Host controller is in the same IOMMU group, and specifying vfio-pci option didn't prevent the device from loading xhci_usb driver.
IOMMU Group 1 00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 07)
IOMMU Group 1 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU106M [GeForce RTX 2060 Mobile] [10de:1f11] (rev a1)
IOMMU Group 1 01:00.1 Audio device [0403]: NVIDIA Corporation TU106 High Definition Audio Controller [10de:10f9] (rev a1)
IOMMU Group 1 01:00.2 USB controller [0c03]: NVIDIA Corporation TU106 USB 3.1 Host Controller [10de:1ada] (rev a1)
| [gcode_macro PREP_PRINT] | |
| description: Loads and starts the print | |
| variable_x_max: 0 | |
| variable_y_max: 0 | |
| variable_z_max: 0 | |
| variable_nozzle: 0 | |
| variable_fila_dia: 0 | |
| variable_bed_temp: 0 | |
| variable_extruder_temp: 0 | |
| variable_chamber_temp: 0 |
| // zod schema | |
| z.object({ | |
| // valid if string or: | |
| optional: z.string().optional(), // field not provided, or explicitly `undefined` | |
| nullable: z.string().nullable(), // field explicitly `null` | |
| nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined` | |
| }); | |
| // type | |
| { |