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 / basecamp.py
Last active November 22, 2024 18:14
A Python script to make calls to the Basecamp 4 API via OAuth authentication.
import datetime
import json
import os.path
import requests
# TO DO: Enter Your BC Account ID
# Example: 999999999 from https://3.basecamp.com/999999999/
BC_ACCOUNT_ID = "<your-client-id>"
# Basecamp App Integration Information
@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 / 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 / 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