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
#!/usr/bin/env bash | |
notify-send --expire-time=10000 --icon=translator "$(xsel -o)" "$(wget -O - "http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=tr&dt=t&q=$(xsel -o)" | awk -F'"' '{print $2}')" | |
gtts-cli "$(xsel -o)" | mpg123 - |
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
# /etc/nextdns.conf | |
# | |
discovery-dns | |
auto-activate false | |
control /run/nextdns/nextdns.sock | |
config CONFIG_ID | |
max-ttl 0s | |
report-client-info true | |
cache-size 10MB | |
bogus-priv true |
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
/* 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 |