Skip to content

Instantly share code, notes, and snippets.

@rstacruz
rstacruz / README.md
Last active April 23, 2024 00:19
Setting up Jest with ESM

Setting up Jest with ESM

Here are some different ways on how to set up Jest to support ESM. This applies for Jest v25, Node v13, and Babel v7.

Method A: Native Node.js support

Node v14 and Jest v26 support ESM natively with the --experimental-vm-modules flag.

Install cross-env:

@mrv1k
mrv1k / .eslintrc.js
Last active September 23, 2022 16:25
Resolve path starting "@/*". eslint-plugin-import / eslint-import-resolver-webpack
/**
* Good article to read what is `@` in `.vue` files
* {@link https://www.jerriepelser.com/blog/til-at-symbol-javascript-import/}
*
* More on `import/no-unresolved` rule:
* {@link https://github.com/benmosher/eslint-plugin-import/blob/HEAD/docs/rules/no-unresolved.md#ignore}
*/
// `/` is just for sanity and can be ommited.
// Add this line to your .eslint.rc
@alexlee-gk
alexlee-gk / configure_cuda_p70.md
Last active March 19, 2024 17:47
Use integrated graphics for display and NVIDIA GPU for CUDA on Ubuntu 14.04

This was tested on a ThinkPad P70 laptop with an Intel integrated graphics and an NVIDIA GPU:

lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM204GLM [Quadro M3000M] (rev a1)

A reason to use the integrated graphics for display is if installing the NVIDIA drivers causes the display to stop working properly. In my case, Ubuntu would get stuck in a login loop after installing the NVIDIA drivers. This happened regardless if I installed the drivers from the "Additional Drivers" tab in "System Settings" or the ppa:graphics-drivers/ppa in the command-line.