Skip to content

Instantly share code, notes, and snippets.

View bskinn's full-sized avatar

Brian Skinn bskinn

View GitHub Profile
@bskinn
bskinn / .sshfs_startup
Last active July 2, 2026 04:26
bash startup-file one-liner for automatic userspace sshfs mount
ping -w1 -c1 "$remote" > /dev/null && ( mount | grep "$remote" > /dev/null || sshfs "$user@$remote:$remote_path" "$local_mnt_path" -o reconnect,ServerAliveInterval=15 )
# Ping once and wait a max of 1s. Only advance if the remote responds.
# These could be larger/longer, but it would increase time to first prompt.
# Suppress output.
#
# ping -w1 -c1 "$remote" > /dev/null && ( ... )
#
# We found the remote; now we check to see if that remote is already mounted
# by grepping the output of mount. We only proceed if grep *fails*, as this
@bskinn
bskinn / vact.bat
Created April 19, 2026 00:33
Windows cmd BAT helper script for activating Python venvs
REM Put somewhere on PATH.
REM I usually add %USERPROFILE%/bin/ to PATH and
REM put this script in there.
REM
REM No suffix, looks for env, .env, venv, and .venv
REM
REM > vact
REM
REM Same, but looks for envSUFFIX, etc.
REM
@bskinn
bskinn / vact.source
Last active May 9, 2026 01:17
Source-able bash function for activating Python venvs
# Search for venvs in pwd with an optional suffix
# and activate the first one found.
#
# $ vact # Activate first found of env, .env, venv, or .venv
# $ vact [SUFFIX] # Activate first found of envSUFFIX, etc.
#
# Add to, e.g., ~/.bash_aliases. This version should
# work in Linux/WSL bash and in Windows Git Bash.
#
@bskinn
bskinn / post_version_scheme.py
Last active February 28, 2026 05:04
Post version bumping setuptools-scm version-scheme callable
import setuptools_scm
from packaging.version import Version
def post_bump_then_dev(version: setuptools_scm.ScmVersion) -> str:
"""
Ahead of tag:
- v0.1 -> 0.1.post1.devN
- v0.1.post1 -> 0.1.post2.devN
Exact tag:
@bskinn
bskinn / ccl_db_archive_info.md
Last active June 21, 2026 00:45
ccl.net Database Archive Info

ccl.net Mailing List Database Archive Info

The Computational Chemistry List (CCL) "was established on January 11, 1991, as an independent electronic forum for chemistry researchers and educators from around the world." It was created and operated for three and a half decades by Jan Labanowski, Ph.D., and comprised many things, including a job board, a software archive, and a document repository. But, its most well known component was almost certainly the [CCL.NET mailing list][list frontpage], via which researchers and educators around the world discussed countless topics in and adjacent to computational chemistry.

@bskinn
bskinn / import_stomp.py
Created January 12, 2025 04:18
Demonstration of 'import stomping' behavior of imports inside functions
import os as foo
import os as bar
print()
print(f"Initial {'rmdir' in dir(foo)=}")
print(f"Initial {'rmdir' in dir(bar)=}")
print()
def no_global():
import sys as foo
@bskinn
bskinn / make_build_requirements.py
Created June 27, 2024 15:43
Script to create requirements file from pyproject.toml build-system.requires
import tomllib
from pathlib import Path
requirements = tomllib.loads(Path('pyproject.toml').read_text())['build-system']['requires']
Path('requirements-build.txt').write_text('\n'.join(requirements))
@bskinn
bskinn / pipc.bat
Created May 10, 2024 04:05
CMD batch script convenience wrapper around pip-compile
@echo off
setlocal
if "%~1"=="" (
echo No pip-compile targets provided.
exit /b 1
)
set CUSTOM_COMPILE_COMMAND=%0 %*
@bskinn
bskinn / git-aliases.txt
Last active February 9, 2026 22:23
Various git aliases
# [alias] has been improved to where you don't need explicit sh calls.
# And, as long as you don't need argument processing, you can just
# alias to whatever you would type after 'git'.
[alias]
# Pretty-printed tree view of the commit history
# Can't remember where I found the incantation.
# logtree shows all commits from *all* branches;
# logbranch only shows commits in the current branch's history
logtree = log --graph --all --oneline --decorate=full
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.