In the middle of the desert you can say anything you want
Git Tag: A Tutorial for Tagging Releases in Git - DEV Community
#ligthweight tag
git tag v1.0.0
# full
git tag -a v1.0.0 -m "Releasing version v1.0.0"
Tags don’t get pushed automatically. For this,
git push origin v1.0.0
uv
uses hatch
which has this to say about dynamic versioning: Configuring project metadata - Hatch[project]
dynamic = ["version"]
[tool.hatch.version]
path = "..."
Path is a python file w/ version info. If using src
layout, src
has to be included in the path.j
For uv, this works. Described for example here: Versioning Python Projects with Hatch
(I like __init__.py
though, not about as that guide does)
uv-dynamic-versioning · PyPI exists but I don’t really see why.
Because every single goddamn time
Command line: How do you rotate a PDF file 90 degrees? - Unix & Linux Stack Exchange
pdftk input.pdf cat 1-endwest output output.pdf
1-
is needed because page range, here for all pages.
endwest
etc from man page:
[<begin page number>[-<end page number>[<qualifier>]]][<page rotation>]
The qualifier can be even or odd, and the page rotation can be north, south, east, west, left, right, or down.
Each option sets the page rotation as follows (in degrees): north: 0, east: 90, south: 180, west: 270, left: -90, right: +90, down: +180. left, right, and down make relative adjustments to a page’s rotation.
This is brilliant: Git, rewrite previous commit usernames and emails - Stack Overflow
TL;DR
git config --global alias.change-commits '!'"f() { VAR=\$1; OLD=\$2; NEW=\$3; shift 3; git filter-branch --env-filter \"if \\\"\$\`echo \$VAR\`\\\" = '\$OLD' ; then export \$VAR='\$NEW'; fi\" \$@; }; f"
Then
git change-commits GIT_AUTHOR_NAME "old name" "new name"
# last 10 commits
git change-commits GIT_AUTHOR_EMAIL "old@email.com" "new@email.com" HEAD~10..HEAD
Depending on why I need this, I may need also GIT_COMMITTER_[NAME/EMAIL]
For multiple times, I created an change-commit-f
that forces overwiriting the backup:
git config --global alias.change-commits-f '!'"f() { VAR=\$1; OLD=\$2; NEW=\$3; shift 3; git filter-branch -f --env-filter \"if \\\"\$\`echo \$VAR\`\\\" = '\$OLD' ; then export \$VAR='\$NEW'; fi\" \$@; }; f"
A quick tldr from other answer, may be better but untested:
git config alias.change-commits '!'"f() { VAR=\$1; OLD=\$2; NEW=\$3; shift 3; git filter-branch --env-filter \"if \\\"\$\`echo \$VAR\`\\\" = '\$OLD' ; then export \$VAR='\$NEW'; fi\" \$@; }; f "
git change-commits GIT_AUTHOR_NAME "<Old Name>" "<New Name>" -f
git change-commits GIT_AUTHOR_EMAIL <old@email.com> <new@email.com> -f
git change-commits GIT_COMMITTER_NAME "<Old Name>" "<New Name>" -f
git change-commits GIT_COMMITTER_EMAIL <old@email.com> <new@email.com> -f
(Previously: 220408-1822 Gitlab ‘you cannot push commits for ..’ error)
Lines of code that beat A/B testing (2012) | Hacker News / 20 lines of code that will beat A/B testing every time
TL;DR: A/B testing that automatically increases how often “good” versions are shown
docker run -it --name inception -p8080:8080 ghcr.io/inception-project/inception:35.1
$ docker run -it --name inception -v /srv/inception:/export -p8080:8080 ghcr.io/inception-project/inception:35.1
/srv/inception
Creating a project automatically fills it with sample data:
Tagsets
{
"name" : "BBK",
"description" : null,
"language" : null,
"tags" : [ {
"tag_name" : "aaa_human_processed",
"tag_description" : null
}, {
"tag_name" : "block",
"tag_description" : null
} ],
"create_tag" : false
}
A layer has to be linked to a feature (string) which then can be linked to a tagset: (INCEpTION User Guide)
annotations get saved automatically
in the viewer, you can set dynamic
for annotations differing based on color
Using uv as your shebang line – Rob Allen (HN comments) and more detailed article on this: Lazy self-installing Python scripts with uv
But especially Defining Python dependencies at the top of the file – Rob Allen and the PEP 723 – Inline script metadata | peps.python.org
You can add uv
to the shebang line as
#!/usr/bin/env -S uv run --script
And you can set requirements by adding this under the shebang line:
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "flickrapi",
# ]
# ///
Then you can uv run sync-flickr-dates.py
Full package:
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "flickrapi",
# ]
# ///
import flickrapi
print("\nI am running")
❯ chmod +x test.py
❯ ./test.py
Installed 11 packages in 134ms
I am running!
Neat!
git - How to cherry-pick multiple commits - Stack Overflow:
For one commit you just pase its hash.
For multiple you list them, in any order.
For a range, you do oldest-latest
but add ~
, ^
or ~1
to the oldest to include it. Quoting directly from the SO answer:
# A. INCLUDING the beginning_commit
git cherry-pick beginning_commit~..ending_commit
# OR (same as above)
git cherry-pick beginning_commit~1..ending_commit
# OR (same as above)
git cherry-pick beginning_commit^..ending_commit
# B. NOT including the beginning_commit
git cherry-pick beginning_commit..ending_commit
TL;DR pipx inject target_app package_to_inject
pipx psutil
it refuses, it’s a library, not an app
psutil
for the MemoryGraph widget in (pipx install
-ed) qtile, that doesn’t helppipx inject qtile psutil
❯ pipx inject qtile psutil
injected package psutil into venv qtile
done! ✨ 🌟 ✨