Skip to content

Instantly share code, notes, and snippets.

View mike-weiner's full-sized avatar

Michael Weiner mike-weiner

View GitHub Profile
@mike-weiner
mike-weiner / vaccine-spotter.py
Last active May 12, 2021 00:47
A Python version of a script that will use the open source Vaccine Spotter API to print out all vaccine centers in a specific city with which vaccine sites have appointments available.
import json
import requests
# get API url provided by https://www.vaccinespotter.org/api/
# this URL can be changed to any of the other states found at the URL above
URL = "https://www.vaccinespotter.org/api/v0/states/MN.json" # CHANGE STATE HERE
requestResponse = requests.get(URL)
parsedJSONResponse = requestResponse.json()
@mike-weiner
mike-weiner / newnote.sh
Last active May 17, 2021 14:55
A bash script that will create a new file with the given name in the command line argument, save it in a specified directory, and open it in VSCode.
#!/bin/bash
#
# Script that will start VSCode with a new file saved in a specified directory to edit.
# Filename of the new file saved will be taken in as an argument
# Directory will be specified within the script
#
# Location of the directory where the files created by the script should be stored
file_location=${HOME}/Documents/Programming/scratchpad
@mike-weiner
mike-weiner / crypto-price.py
Last active July 8, 2021 01:22
A Python script that uses the Coinbase API to get the current spot price of specified cryptocurrencies.
# import required tools
import requests
from datetime import datetime
# print current date and time
print(datetime.now())
print()
# define array of cryptos to get the spot price of
CRYPTO = ["BTC-USD", "ETH-USD", "LTC-USD"] # Change this array to set what crypto currencies you want a spot price of
@mike-weiner
mike-weiner / opensea.py
Created January 5, 2022 01:17
A Python script to utilize the OpenSea API to get all available information on a single asset listed.
import json
import requests
# https://opensea.io/assets/<your-asset-contract-address>/<your-token-id>
ASSETCONTRACTADDRESS = "<your-asset-contract-address>" # Replace with your Asset Contract Address
TOKENID = "<your-token-id>" # Replace with your Token ID
# Construct URL for OpenSea API to make GET call
url = "https://api.opensea.io/api/v1/asset/" + ASSETCONTRACTADDRESS + "/" + TOKENID + "/"
@mike-weiner
mike-weiner / gh-parser.sh
Last active January 23, 2022 02:32
A bash script that uses the GitHub CLI and JQ to parse and print specific information about open Issues or PRs using .
#!/bin/bash
# Function that will print requirements if the user passes in the -help flag as the first argument
function help
{
echo "Parameters are: "
echo "[Required]: search-term"
}
# Check for '-help' flag
@mike-weiner
mike-weiner / gh-count.sh
Last active January 23, 2022 02:35
A bash script that will return a count of all open issues by Github username.
#!/bin/bash
gitUsernames=("github-username1" "github-username2")
echo "Open Issues (by user)"
echo "---"
# https://cli.github.com/manual/
for username in ${gitUsernames[@]}; do
echo -n "$username: "
@mike-weiner
mike-weiner / crypto-portfolio-price.py
Last active May 13, 2022 19:26
A Python script that uses the Coinbase API to get the current spot total of specified portfolio of cryptocurrencies.
# import required tools
import requests
from datetime import datetime
# print current date and time
print(datetime.now())
print()
# define array of cryptos & quantities owned
# TO DO: Enter Your Portfolio Holdings
@mike-weiner
mike-weiner / docker-alias.sh
Created May 21, 2022 00:24
An alias to start Docker Desktop from the command line.
alias startdocker='open -a docker'
@mike-weiner
mike-weiner / git-command-line-prompt.sh
Created May 21, 2022 00:27
Modifies the command line prompt to include Git repository information (if applicable).
# Modifies the Command Line Prompt to the following format:
# <Username> <Current Directory Name> <Current Git Branch Name (if applicable)> %
# Load version control information
autoload -Uz vcs_info
precmd() { vcs_info }
# Format the vcs_info_msg_0_ variable
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' formats '(%b)'
@mike-weiner
mike-weiner / videocrop.sh
Last active January 11, 2023 02:48
A bash script that uses FFmpeg to crop a video.
#!/bin/bash
# Function that will print requirements if the user passes in the -help flag as the first argument.
function help
{
echo "Parameters are: "
echo " <filename>: The full filename of the video that you want to crop."
}
# Check for '-help' flag.