Skip to content

Instantly share code, notes, and snippets.

View bitbay's full-sized avatar

Daniel bitbay

  • bitbay.org
  • yer vast seas of the internest
View GitHub Profile
@bitbay
bitbay / docker-compose.yml
Created December 23, 2021 10:17
Docker compose with minimal nginx reverse-proxy with localhost subdomain
version: '3.9'
services:
nginx:
image: nginx:1.20.2-alpine
ports:
- 80:80
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
@bitbay
bitbay / randoms.js
Created March 5, 2020 08:29
Random helpers
/**
* @param {number} max the upper bound of the result
* @return {number} random number up to (but not including) max value [0, max)
*/
const randomUpTo = max => Math.floor(Math.random() * max);
/**
* @param {number|undefined} prob if defined, probability (percent) of the outcome being true
* @return {boolean} [true|false]
*/