This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
if "%~1"=="" ( | |
echo No pip-compile targets provided. | |
exit /b 1 | |
) | |
set CUSTOM_COMPILE_COMMAND=%0 %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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) " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Helper script to properly merge two one-sided scans of a PDF, | |
# where the odd-numbered pages are scanned in order but the | |
# even-numbered pages are scanned in reverse order. | |
# | |
# Requires PyPDF2 ('pip install PyPDF2') | |
# | |
# Input PDFs should be named the same thing, with _odd and _even as | |
# suffixes to the filename (e.g., doc_odd.pdf and doc_even.pdf). | |
# Pass the base filename into the script, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ANALYZING SYMMETRY OF NORMAL MODES... | |
FREQUENCIES IN CM**-1, IR INTENSITIES IN DEBYE**2/AMU-ANGSTROM**2, | |
REDUCED MASSES IN AMU. | |
1 2 3 4 5 | |
FREQUENCY: 2.81 0.66 0.37 0.17 2.03 | |
SYMMETRY: A A A A A | |
REDUCED MASS: 9.40532 8.22898 8.71590 8.67428 8.49811 | |
IR INTENSITY: 0.00584 0.00020 0.00001 0.00001 0.00463 |
NewerOlder