Skip to content

Instantly share code, notes, and snippets.

View bitmvr's full-sized avatar

Jesse Riddle bitmvr

View GitHub Profile
@bitmvr
bitmvr / pokemon-scraper.js
Created April 23, 2024 15:26
Pokemon Scraper
/* The follwing Javascript is to be used inside a browser's console to extract
data from the first three columns of the table. The website this code is designed
for is: https://www.serebii.net/pokemon/gen6pokemon.shtml
*/
var tableRows = document.querySelectorAll('.dextable tr');
var csvContent = '';
tableRows.forEach(function(row) {
var rowData = [];
@bitmvr
bitmvr / gist:dd7dba2c0a5230ed271ab60cb45b157c
Created April 4, 2024 02:30
Javascript Oscillation / DTMF Songs
#!/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" },
@bitmvr
bitmvr / generate-plex-movie-filename.js
Last active April 3, 2024 19:25
Bookmarklet for Generating Plex Supported Filename for Movies from TMDB or IMDB
/*
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.
*/
@bitmvr
bitmvr / parseable-curl-response-example.sh
Last active January 7, 2024 15:12
Create Parseable cURL Response with Bash and jq
#!/usr/bin/env bash
__http_request_example(){
curl \
--silent \
--location http://ip.jsontest.com \
--write-out "\n%{http_code}"
}
__response_formatter(){
@bitmvr
bitmvr / spotify-get-artist.sh
Last active December 18, 2023 17:45
Spotify API Example | Get Artist
#!/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
@bitmvr
bitmvr / rename-columns.py
Last active September 19, 2023 14:19
Altering Columns in a PostGIS enabled Postgres DB with Python
#!/usr/bin/env python3
import psycopg2
import json
# The db-config follows this schema.
#
# {
# "database": {
# "host": "TARGET_HOSTNAME",
@bitmvr
bitmvr / generate-join-wifi-qrcode.md
Last active July 18, 2021 19:38
Generate Wi-Fi Config QR Code

Generate Wi-Fi Card on macOS

Create ./generate-wifi-config.sh

  1. Copy the contents of the code block below.
  2. Paste it into a file
  3. Save it as generate-wifi-config.sh
  4. Execute: chmod +x ./generate-wifi-config.sh to make it executable.

Note: Upon execution, your operating system is going to ask for your machine password. It does this because the script obtains your Wi-Fi password that is stored in the macOS Keychain.

@bitmvr
bitmvr / chipr.sh
Created March 23, 2021 12:45
chipr.sh - Delete merged branches from local and remote.
#!/usr/bin/env bash
# set -x
if [ $# -eq 0 ]; then
echo "ERROR: Please provide the MAIN branch for this project in order to exclude it."
exit 1
fi
readonly MAIN_BRANCH="$1"
@bitmvr
bitmvr / install-xpdf-japanese-language-package.md
Last active March 21, 2021 15:20
Install xpdf Japanese Language package

Install XPDF Japanese Language Package

Step 1: Download the Japanese Language Package

curl -sL https://dl.xpdfreader.com/xpdf-japanese.tar.gz -o "$HOME/Downloads/xpdf-japanese.tar.gz"

Step 2: Create the required directories and files.

@bitmvr
bitmvr / raspbian-buster-matrix-synapse-install.md
Last active January 31, 2021 13:32
Installing Matrix-Synapse on Raspbian Buster

Install Synapse on Raspbian GNU/Linux 10 (buster)

A step-by-step guide for installing Synapse on Raspbian Buster.

Pre-requisites

Install Software

  1. Execute: sudo apt-get install build-essential
  2. Execute: sudo apt-get install python3-dev
  3. Execute: sudo apt-get install libffi-dev