Skip to content

Instantly share code, notes, and snippets.

@fmented
fmented / scale.js
Created August 11, 2021 22:37 — forked from fpillet/scale.js
Javascript value scaling between two ranges
/* Scale a value from one range to another
* Example of use:
*
* // Convert 33 from a 0-100 range to a 0-65535 range
* var n = scaleValue(33, [0,100], [0,65535]);
*
* // Ranges don't have to be positive
* var n = scaleValue(0, [-50,+50], [0,65535]);
*
* Ranges are defined as arrays of two values, inclusive
# see https://docs.searxng.org/admin/engines/settings.html#use-default-settings
use_default_settings: true
general:
instance_name: "instance_name"
server:
# base_url is defined in the SEARXNG_BASE_URL environment variable, see .env and docker-compose.yml
secret_key: "ultrasecretkey" # change this!
limiter: true # can be disabled for a private instance
image_proxy: true
ui: