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 node | |
var dtmf = { | |
"0":{ "hf": "1336", "lf": "941" }, | |
"1":{ "hf": "1209", "lf": "697" }, | |
"2":{ "hf": "1336", "lf": "697" }, | |
"3":{ "hf": "1477", "lf": "697" }, | |
"4":{ "hf": "1209", "lf": "770" }, | |
"5":{ "hf": "1336", "lf": "770" }, | |
"6":{ "hf": "1477", "lf": "770" }, |
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
// Navigate to http://onlinetonegenerator.com/dtmf.html | |
// Open DevTools - Console | |
// Paste the Code | |
// Press Enter | |
// Provide the number of milliseconds the default tone should hold for | |
var short = 250; | |
var long = short * 2; | |
function sleep(ms) { |
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
/* | |
The following code is used to generate a string that adheres to a Plex filename | |
convention for movie titles. This code can strip page titles from either | |
TMDB or IMDB and put them in dot notation of: | |
Movie.Title.Year.{source-sourceId} | |
An extension is not provided as I do not know the extension of the target file. | |
*/ |
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 | |
__http_request_example(){ | |
curl \ | |
--silent \ | |
--location http://ip.jsontest.com \ | |
--write-out "\n%{http_code}" | |
} | |
__response_formatter(){ |
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 | |
NUM_OF_STORIES="$1" | |
getTopStoryIds(){ | |
curl -sL "https://hacker-news.firebaseio.com/v0/topstories.json" | tr -d '[]' | tr ',' '\n' | |
} | |
getStoryData(){ | |
storyID="$1" |
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 | |
VERSION="$1" | |
VERSION="${VERSION#[vV]}" | |
VERSION_MAJOR="${VERSION%%\.*}" | |
VERSION_MINOR="${VERSION#*.}" | |
VERSION_MINOR="${VERSION_MINOR%.*}" | |
VERSION_PATCH="${VERSION##*.}" | |
echo "Version: ${VERSION}" |
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
sed -E 's/(^[^#].*$)/INSERT_TEXT_HERE \1/' |
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 | |
SEMANTIC_VERSION='1.2.3' | |
SEMVER_ARRAY=(${SEMANTIC_VERSION//./ }) | |
echo "MAJOR: ${SEMVER_ARRAY[0]}" | |
echo "MINOR: ${SEMVER_ARRAY[1]}" | |
echo "PATCH: ${SEMVER_ARRAY[2]}" |
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 | |
function cwdmon::getPIDsByAppName(){ | |
appName="${1}" | |
pgrep -a $appName | |
} | |
function cwdmon::getAllCWDs(){ | |
for PID in $(cwdmon::getPIDsByAppName 'bash'); do | |
lsof -p "$PID" | grep -i "cwd" | awk '{ print $9}' |
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 | |
# Learn More About Spotify API | |
# https://developer.spotify.com/documentation/web-api/tutorials/getting-started | |
if [ -z "${SPOTIFY_CLIENT_ID}" ] || [ -z "${SPOTIFY_CLIENT_SECRET}" ]; then | |
echo "SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET must be set." | |
exit 1 | |
fi |
NewerOlder