I have summarized and compiled a list of React.JS best practices from various sources across the internet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
if [ -n "$POSTGRES_DATABASES" ]; then | |
echo "POSTGRES_DATABASES provided. Creating multiple databases..." >&2 | |
IFS=', '; for db in $POSTGRES_DATABASES; do | |
echo "Creating '$db'" >&2 | |
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-ESQL | |
CREATE USER "$db"; | |
CREATE DATABASE "$db"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"firestore": { | |
"rules": "firestore.rules", | |
"indexes": "firestore.indexes.json" | |
}, | |
"emulators": { | |
"firestore": { | |
"port": 8080 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Angular CLI version | Angular version | Node.js version | TypeScript version | RxJS version | |
---|---|---|---|---|---|
~16.0.0 | ~16.0.0 | ^16.13.0 || ^18.10.0 | >=4.9.5 <5.1.0 | ^6.5.5 || ^7.4.0 | |
~15.2.0 | ~15.2.0 | ^14.20.0 || ^16.13.0 || ^18.10.0 | >=4.8.4 <5.0.0 | ^6.5.5 || ^7.4.0 | |
~15.1.0 | ~15.1.0 | ^14.20.0 || ^16.13.0 || ^18.10.0 | >=4.8.4 <5.0.0 | ^6.5.5 || ^7.4.0 | |
~15.0.5 | ~15.0.4 | ^14.20.0 || ^16.13.0 || ^18.10.0 | ~4.8.4 | ^6.5.5 || ^7.4.0 | |
~14.3.0 | ~14.3.0 | ^14.15.0 || ^16.10.0 | >=4.6.4 <4.9.0 | ^6.5.5 || ^7.4.0 | |
~14.2.0 | ~14.2.0 | ^14.15.0 || ^16.10.0 | >=4.6.4 <4.9.0 | ^6.5.5 || ^7.4.0 | |
~14.1.3 | ~14.1.3 | ^14.15.0 || ^16.10.0 | >=4.6.4 <4.8.0 | ^6.5.5 || ^7.4.0 | |
~14.0.7 | ~14.0.7 | ^14.15.0 || ^16.10.0 | >=4.6.4 <4.8.0 | ^6.5.5 || ^7.4.0 | |
~13.3.0 | ~13.3.0 | ^12.20.2 || ^14.15.0 || ^16.10.0 | >=4.4.4 <4.7.0 | ^6.5.5 || ^7.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Given } from 'cucumber'; | |
/** | |
* Transform a cucumberjs data table to an Array | |
* | |
* @example | |
* <pre> | |
* // insert from featurefile | |
* Given a table hashes step | |
* | Vegetable | Rating | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch | grep -v "master\|develop" | xargs git branch -D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# dependencies | |
echo "Installing dependencies via Homebrew (http://brew.sh)" | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
brew update | |
brew install gcc48 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is an example of using elastic's BulkProcessor with Elasticsearch. | |
// | |
// See https://github.com/olivere/elastic and | |
// and https://github.com/olivere/elastic/wiki/BulkProcessor | |
// for more details. | |
/* | |
* This example illustrates a simple process that performs bulk processing | |
* with Elasticsearch using the BulkProcessor in elastic. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// haversin(θ) function | |
func hsin(theta float64) float64 { | |
return math.Pow(math.Sin(theta/2), 2) | |
} | |
// Distance function returns the distance (in meters) between two points of | |
// a given longitude and latitude relatively accurately (using a spherical | |
// approximation of the Earth) through the Haversin Distance Formula for | |
// great arc distance on a sphere with accuracy for small distances | |
// |
NewerOlder