Here are some different ways on how to set up Jest to support ESM. This applies for Jest v25, Node v13, and Babel v7.
Node v14 and Jest v26 support ESM natively with the --experimental-vm-modules
flag.
Install cross-env
:
const SomeComponent = ({ className }) =>
<div className={classnames('bg-red', className)} />
<SomeComponent className="bg-blue"/>
What background color will the component have? The div will end up with class="bg-red bg-blue"
, so precedence depends on whether the specifiers for .bg-red
was generated before or after specifiers for .bg-blue
in the css file
// this will only work if window.map === your mapboxgl map instance | |
// we usually set window.map = map in the callback using map.on('style.load', function () { ... }) | |
fetch('https://maputnik-push.planninglabs.nyc/style', { | |
method: 'POST', | |
headers: { | |
Accept: 'application/json', | |
'Content-Type': 'application/json', | |
}, | |
body: JSON.stringify(window.map.getStyle()), |
All usefull data must be downloaded from https://s3-us-west-2.amazonaws.com/remotepixel-pub/data/IMW/IMW2018_QGIS_data_processing.zip
// This code queries postgresql and streams the results into a csv | |
// Works like a charm for a download button, no hangup for large files! | |
const Json2csvTransform = require('json2csv').Transform; | |
const QueryStream = require('pg-query-stream'); | |
const JSONStream = require('JSONStream'); | |
router.get('/download.csv', async (req, res) => { | |
const { query } = req; |
(note, there are likely many ways to do this, this is just what worked for me but it should work for you; but nonetheless: proceed at your own risk!
#!/usr/bin/ruby -W1 | |
# frozen_string_literal: true | |
require 'optparse' | |
require 'shellwords' | |
# A script to automate changelog generation from Git commit messages | |
# | |
# For use with a git-flow workflow, it will take changes from the last tagged | |
# release where commit messages contain NEW, FIXED, CHANGED, and IMPROVED |
www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com
is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).update: A minor variant of the viru
Here's a list of my issues with the Brave web browser (www.brave.com).
https://github.com/brave/browser-laptop/projects/1
# gradients based on http://bsou.io/posts/color-gradients-with-python | |
def hex_to_RGB(hex): | |
''' "#FFFFFF" -> [255,255,255] ''' | |
# Pass 16 to the integer function for change of base | |
return [int(hex[i:i+2], 16) for i in range(1,6,2)] | |
def RGB_to_hex(RGB): | |
''' [255,255,255] -> "#FFFFFF" ''' |