Skip to content

Instantly share code, notes, and snippets.

View RackReaver's full-sized avatar

Matt Ferreira RackReaver

View GitHub Profile
@RackReaver
RackReaver / get_current_quarter_number.py
Last active October 27, 2022 13:25
python:function: get the current quarter number
from datetime import datetime
# Get quarter number
get_current_quarter_number():
today = int(datetime.now().strftime('%m'))
if today == 1 or today == 2 or today == 3:
quarter_number = 1
elif today == 4 or today == 5 or today == 6:
quarter_number = 2
elif today == 7 or today == 8 or today == 9:
@RackReaver
RackReaver / Fix ssh-agent
Created February 17, 2022 19:34
Signing failed for ECDSA-SK
eval `ssh-agent -s`
ssh-add
pip freeze | grep -v -f requirements.txt - | xargs pip uninstall -y

myGolf Index

Provide all golfers with the information they need to improve their game.

  • Easy Score Input
  • Edit Past Data Anytime
  • Track Your Friends
  • Printable Stat Sheets
  • Basic and Advanced Stats
  • Mobile First
@RackReaver
RackReaver / append_csv.py
Last active May 10, 2021 17:55
python snippets
def append_csv(filename, value):
"""This will append a vaule to a csv file.
args:
filename (str): full path or relative path of the csv file.
value (str): string to append to the csv file.
Return: None
"""
with open(filename, 'a') as openFile:
openFile.write('\n{}'.format(value))
@RackReaver
RackReaver / function_doc_str.py
Created May 10, 2021 17:55
python:doc_str: function documentation string
"""Description here
args:
arg1 (type): description
arg2 (type): description
kwargs:
kwargs (type): description
kwargs (type): description
@RackReaver
RackReaver / jinja-snippets.html
Last active May 10, 2021 17:53
python: currency formatting
"${:,.2f}".format(input)
@RackReaver
RackReaver / count_git_lines.sh
Last active May 10, 2021 17:51
bash:script: count code lines (git)
# While inside of git repository this command will output lines of code written by each author.
git ls-files | while read f; do git blame -w --line-porcelain -- "$f" | grep -I '^author '; done | sort -f | uniq -ic | sort -n
@RackReaver
RackReaver / cs_fdr_unzipper.py
Last active May 10, 2021 17:50
crowdstrike:script: falcon data replicator unzipper
# PYTHON 2.7
def unzip_data(src, dest):
"""Unzips *.gz file and places it in new location following the same directory structure.
args:
src (str): *.gz file to be unzipped
dest (str): drop location for unzipped file
return: None
@RackReaver
RackReaver / USAGE.md
Created August 30, 2020 02:57 — forked from mterwill/USAGE.md
Beancount importers, scripts, etc.

Note: everything here is pretty specific to my usage/accounts and not written for public use... You'll probably have to tweak a bunch of stuff.

$ bean-extract config.py ~/Downloads # the csvs should be in here