mongo >= 6
: init-mongo.js
+ MONGO_INITDB_DATABASE
in .env-mongo
mongo < 6
: init-mongo.sh
+ no MONGO_INITDB_DATABASE
in .env-mongo
.env
:
MONGO_USER=user
MONGO_PASSWORD=userpasswd
#!/usr/bin/env node | |
const path = require('path') | |
const inquirer = require('inquirer') | |
const replace = require('replace-in-file') | |
const isCI = require('is-ci') | |
const spawn = require('cross-spawn') | |
const fileGlob = process.argv[2] || 'src/**/*.*' | |
const files = path.isAbsolute(fileGlob) |
Starting a personal node project could be easy; starting a team node project could be challenging.
I am a developer currently working in SEEK Australia.
In my experience, common mistakes developer make when starting a projects are:
For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):
List All System Images Available for Download: sdkmanager --list | grep system-images
Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"
UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker
now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.
Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/
sudo amazon-linux-extras install docker
sudo service docker start
{ | |
"key": "alt+k", | |
"command": "selectNextSuggestion", | |
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" | |
}, | |
{ | |
"key": "alt+j", | |
"command": "selectPrevSuggestion", | |
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" | |
} |
sudo apt install -y autoconf automake build-essential python-dev libtool libssl-dev pkg-config | |
cd /tmp | |
git clone https://github.com/facebook/watchman.git -b v4.9.0 --depth 1 | |
cd watchman/ | |
./autogen.sh | |
./configure --enable-lenient | |
make | |
sudo make install |
Not all random values are created equal - for security-related code, you need a specific kind of random value.
A summary of this article, if you don't want to read the entire thing:
Math.random()
. There are extremely few cases where Math.random()
is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.crypto.getRandomBytes
directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.uuid
, specifically the uuid.v4()
method. Avoid node-uuid
- it's not the same package, and doesn't produce reliably secure random values.random-number-csprng
.You should seriously consider reading the entire article, though - it's
// thanks sleepycat https://github.com/sleepycat/mapboxgl-webpack-example | |
import mapboxgl from 'mapbox-gl' | |
mapboxgl.accessToken = 'pk.eyJ1IjoibWlrZXdpbGxpYW1zb24iLCJhIjoibzRCYUlGSSJ9.QGvlt6Opm5futGhE5i-1kw'; | |
var map = new mapboxgl.Map({ | |
container: 'map', // container id | |
style: 'mapbox://styles/mapbox/streets-v8', //stylesheet location | |
center: [-74.50, 40], // starting position | |
zoom: 9 // starting zoom |