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
# All the available time zones are in directory /usr/share/zoneinfo | |
# Choose whichever one you want and replace the path below | |
ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime |
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
// Code snippet taken from: | |
// https://stackoverflow.com/questions/8498592/extract-hostname-name-from-string | |
function getHostNameFromURL(url) { | |
if (!url) { | |
return null; | |
} | |
let hostname; | |
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
// Code snippet taken from: | |
// https://stackoverflow.com/a/31687097 | |
function scaleBetween(unscaledNum, minAllowed, maxAllowed, min, max) { | |
return (maxAllowed - minAllowed) * (unscaledNum - min) / (max - min) + minAllowed; | |
} |
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 python3 | |
# NOTE 1: Add the username and password to your IBM Watson account below | |
# (More info: https://www.ibm.com/watson/services/text-to-speech/) | |
# NOTE 2: this example requires PyAudio because it uses the Microphone class | |
# pip3 install pyaudio | |
# if getting an error do | |
# brew remove portaudio | |
# brew install portaudio |