Skip to content

Instantly share code, notes, and snippets.

View bitmvr's full-sized avatar

Jesse Riddle bitmvr

View GitHub Profile
@bitmvr
bitmvr / get_participants_from_google_meet.js
Last active January 26, 2021 22:59
getParticipantsFromGoogleMeet - Javascript to return a list of all users from a Google Meet Participants
let scrubParticipants = function(participant) {
if ( participant.includes('You') || participant.includes('Presentation')) {
participant = participant.replace('(You)','');
participant = participant.replace('Presentation','');
participant = participant.replace('\n','');
}
return participant;
}
@bitmvr
bitmvr / hackn.sh
Last active January 6, 2024 14:02
hackn - A lightweight hacker news CLI tool.
#!/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"
@bitmvr
bitmvr / chipr.sh
Last active November 19, 2020 22:33
Chipr cleans up remote branches from your projects remote repository.
#!/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 / calpoc.sh
Created September 4, 2020 13:00
Calculate Percentage of Change
#!/usr/bin/env bash
usage(){
echo "$(basename "$0") start_value end_value"
}
# Check if any flags or values were passed
if [ "$#" -eq 0 ]; then
usage
exit
@bitmvr
bitmvr / covid-national-data-notes.txt
Created August 12, 2020 12:21
Covid National Data Notes
# For the national data, add NULL_FIELD to 'empty' columns so that the cut is performed correctly
# sed -i -- "s/,,/,NULL_FIELD,/g" ts-covid-us-null-filled.csv
# cat ./ts-covid-us.csv | cut -d ',' -f6-7,12- > ./filtered.csv
@bitmvr
bitmvr / istioctl-installer.sh
Last active April 23, 2020 22:46
An istioctl installer - Easily install istioctl
#!/bin/sh
__getLatestVersion(){
request="$(curl -sI https://github.com/istio/istio/releases/latest | grep "^location")"
request="${request##*/}"
echo "$request" | tr -d '\r'
}
__getOperatingSystem(){
get_system_name="$(uname | tr '[:upper:]' '[:lower:]')"
@bitmvr
bitmvr / example--parse-semver-with-bash.sh
Last active January 6, 2024 14:02
Parsing SemVer with Bash
#!/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}"
@bitmvr
bitmvr / the-feed-qr-codes.md
Last active November 30, 2019 21:21
The Feed - QR Codes
@bitmvr
bitmvr / hosts.ps1
Created November 14, 2019 20:00
Powershell script for adding/removing/viewing entries to the hosts file. [ MIRROR for https://gist.github.com/markembling/173887 ]
#
# Powershell script for adding/removing/showing entries to the hosts file.
#
# Known limitations:
# - does not handle entries with comments afterwards ("<ip> <host> # comment")
#
$file = "C:\Windows\System32\drivers\etc\hosts"
function add-host([string]$filename, [string]$ip, [string]$hostname) {
@bitmvr
bitmvr / automation_hacks_for_Win_10.ps1
Created November 6, 2019 19:41
Automation Hacks for Windows 10
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.20.2, 2018-09-14
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...