Skip to content

Instantly share code, notes, and snippets.

View shitchell's full-sized avatar

Shaun Mitchell shitchell

View GitHub Profile
@shitchell
shitchell / hl.py
Last active November 30, 2021 19:28
a simple script for automatically playing games of higher/lower for the purpose of calculating the odds of winning using different methods
#!/usr/bin/env python
HIGHER: int = 3
EXACT: int = 2
LOWER: int = 1
AUTO: int = 0
def run(mode: int = AUTO, ceil: int = 100, repeat: int = 10):
"""
Runs a sequence of Higher/Lower games using the given answering method and
@shitchell
shitchell / git-ignore
Last active December 21, 2021 17:08
a simple git subcommand for adding files to the .gitignore
#!/bin/bash
#
# This file is used to ignore files and folders in git.
#
# usage:
# git ignore
# git ignore <file1|pattern1> <file2|pattern2> ...
#
# - If no arguments are given, the .gitignore file will be opened in your
# default $EDITOR.
@shitchell
shitchell / git-user-stats
Last active February 27, 2025 13:26
Show user stats in a git repo
#!/bin/bash
#
# Show user stats (commits, files modified, insertions, deletions, and total
# lines modified) for a repo
git_log_opts=( "$@" )
git log "${git_log_opts[@]}" --format='author: %ae' --numstat \
| tr '[A-Z]' '[a-z]' \
| grep -v '^$' \
@shitchell
shitchell / python-build.md
Last active February 10, 2025 16:03
Python Build

python build pre-requisites

ubuntu

# Ubuntu 20
apt install build-essential libbz2-dev libc6-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libssl-dev openssl python-dev python-pip python-setuptools python-smbus tk-dev xz-utils zlib1g-dev

# Ubuntu 22
apt install build-essential libbz2-dev libc6-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libssl-dev openssl python3-dev python-pip python-setuptools python3-smbus tk-dev xz-utils zlib1g-dev