Skip to content

Instantly share code, notes, and snippets.

View fitzy1321's full-sized avatar

Joe Fitzgibbons fitzy1321

View GitHub Profile
@fitzy1321
fitzy1321 / typer_example.py
Created August 21, 2025 05:57
Typer add `-h` flag
import typer
app = typer.Typer(context_settings={"help_options_names": ["-h","--help"]})
# ...
if __name__ == "__main__":
app()
@fitzy1321
fitzy1321 / csv_inspector.ipynb
Last active December 3, 2024 23:29
csv inspector notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<a href="https://fitzypop.deno.dev" target="_blank" rel="noopener noreferrer">Fitzypop's Blog</a>
@fitzy1321
fitzy1321 / pytest_slow_marker.md
Last active January 10, 2023 02:50
Pytest slow test marker

Mark a test as slow and skip it

# In pyprojct.toml
[tool.pytest.ini-options]
markers = ["slow: mark tests as slow (deselect with '--runslow')"]

Add the following to your conftest.py file:

@fitzy1321
fitzy1321 / vscode_pytest_troubleshooting.md
Last active December 7, 2022 21:26
VSCode and pytest troubleshooting

VSCode and pytest

If your encountering problems running pytest in vscode testing panel, create an .env file with the following:

# .env
PYTHONPATH="./<package_name>;${PYTHONPATH}"

Make sure to add .env to your .gitignore file

@fitzy1321
fitzy1321 / git-diff.md
Last active April 24, 2024 17:51
Exclude files from git diff

How to exclude files from git diff

# fish shell
set _git_ignore_list "':!/*Cargo.lock' ':!/*deno.lock' ':!/*package-lock.json' ':!/*poetry.lock' ':!/*yarn.lock'"
# fish abbreviation gdnl, stands for "git diff no lock"
abbr -a gdnl git diff -- $_git_ignore_list
@fitzy1321
fitzy1321 / fix.md
Created September 15, 2022 17:30
Fix xcode install loop problem

How to fix xcode install loop after upgrading macOS

I recently upgrade my mac to 12.6, and xcode command line tools is now in an install loop. Preventing me from running make commands, I found this stack overflow post.

TL;DR: my need to reset path to xcode tools (I think)

xcode-select -s /Library/Developer/CommandLineTools
@fitzy1321
fitzy1321 / regex_example.md
Last active April 24, 2024 18:04
No whitespace in text input Regex

No whitespace in text input Regex

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
 Input Regex
@fitzy1321
fitzy1321 / scoped_session_maker.py
Last active July 5, 2022 19:28
SQLAlchemy scoped_session contextmanager
from contextlib import contextmanager
from typing import Generator
from sqlalchemy import create_engine
from sqlalchemy.orm import Session, scoped_session, sessionmaker
@contextmanager
def scoped_session_maker(
db_conn: str,
@fitzy1321
fitzy1321 / starship_git_bash_windows.md
Last active October 1, 2024 12:03
Installing Starship.rs on Git Bash for Windows

Installing Starship prompt on Git Bash for Windows

Source: https://bleepcoder.com/starship/640385008/unable-to-install-on-windows-git-bash-configuration-not

All scripts should be ran in your git bash terminal, not cmd or ps.

  1. Make/Choose folder where to install: mkdir -p ~/bin/starship && cd ~/bin
  2. Download the install script: curl -fsSL https://starship.rs/install.sh > ./install.sh
  3. Run install script: ./install.sh --bin-dir /c/Users/<username>/bin/starship/ --platform pc-windows-msvc
  4. Finally add the following to the end of your .bashrc file: