Skip to content

Instantly share code, notes, and snippets.

View bskinn's full-sized avatar

Brian Skinn bskinn

View GitHub Profile
@bskinn
bskinn / ccl_db_archive_info.md
Last active August 4, 2025 23:04
ccl.net Database Archive Info

ccl.net 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, incluing 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 June 12, 2025 16:00
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 = log --graph --all --oneline --decorate=full
# Same as logtree, but adds timestamps for each commit
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bskinn
bskinn / python_support_email.txt
Created April 1, 2021 14:35
Email requesting consideration of corporate support for Python (Q4 2020)
Dear {recipient},
Given the appreciable business value we have derived from Python and its related scientific tooling over the last few years, at no direct cost to the company, would there be room for {company} to contribute financially to the 501(c)(3) organizations that support these tools?
• Python Software Foundation (supporting the Python language itself): https://www.python.org/psf/
o Q4 2020 funding drive: https://www.python.org/psf/donations/2020-q42020-drive/
• NumFOCUS (supporting nearly all of the scientific packages leveraged in {company} work): https://numfocus.org/
o Currently have an end-of-2020 fundraiser running with a 100% sponsored match: https://numfocus.org/donate-eoy-2020
To note, both organizations have corporate sponsorship programs, which provide defined benefits in exchange for contributions of various sizes:
@bskinn
bskinn / vmake.bat
Created January 19, 2021 16:53
Windows batch file for quick virtualenv creation
@echo off
for /f "tokens=*" %%C in ( 'python3.9 -c "import os, re; print(re.search(r'[^\\]+$', os.getcwd(), re.M).group(0))"' ) do (
set DIRNAME=%%C
)
if [%2]==[] (
python%1 -m virtualenv env --prompt="(%DIRNAME%) "
) else (
python%1 -m virtualenv env --prompt="(%2) "
@bskinn
bskinn / flake8_ext_test.py
Last active September 3, 2022 02:19
Python module designed to raise errors from various flake8 plugins
"""Source file with intentionally broken flake8 things.
Meant to test that various flake8 extensions are correctly installed.
Does NOT rigorously test all errors for all packages!
If you would like an addin or specific error added to this module,
please let me know on Twitter @btskinn.
Invoke with `flake8 --max-complexity 1 flake8_ext_test.py`;
this file should raise AT LEAST the following:
@bskinn
bskinn / flake8_pypi.py
Last active March 19, 2019 14:58
Quick script for listing all "flake8*" packages on PyPI
import json
import re
import requests as rq
pat = re.compile(b'href="/simple/([^/]+)/">')
req = rq.get('https://pypi.org/simple')
for mch in pat.finditer(req.content):
pkg = mch.group(1).decode()