In the middle of the desert you can say anything you want
Setting is per-project and lives in push rules:
I set the credentials to the right ones the usual ways:
git config user.email "my@verified-ema.il"
But the commits were still using the old identity.
Solution to fix the last commit by only setting the author to the new / current one:
git commit --amend --reset-author --no-edit
EDIT for more than last commit, see 250215-1716 Git change name or email in commit history
Hugo summaries are weird.
.Summary returns whatever summary it has, which is either the .. more .. tag, then everything before it gets returned including formatting, or whatever is set in the settings as summary length, while removing markdown formatting.
There was no easy way to get an auto-summary with preserved formatting, except manually adding stuff.
What I really wanted is to truncate posts manually when needed, and leave the rest in full by default while preserving formatting.
Setting the limit to infinite made .Summary returned the full post with stripped formatting.
(I needed this for footnotes in multiple posts all on the home page, they got mixed up and there were no clean solutions. The blackfriday renderer could fix this, but not the default goldmark, which I’m using for some layout issues it does better.)
After googling for better ways to truncate with preserved formatting, found Summary .Render · Scott Willsey
It has this code for a better summarization:
{{ if gt ( sub (len (plainify .Content)) (len .Summary)) 10 }}
{{ .Content | replaceRE "<sup.+>.+</sup>" "" | safeHTML | truncate (len .Summary) }}
<p><i>(<a href="{{ .RelPermalink }}">Read More</a>)</i></p>
{{ else }}
{{ .Content | safeHTML }}
{{- end -}}
{{- if .Params.linkurl -}}
<p><a href="{{ .RelPermalink }}"><i class="fas fa-level-down-alt fa-xs"></i> Permalink</a></p>
{{- end -}}
First up is an if statement that checks to see if the post even needs to be truncated into a summary or not, or whether it’s short enough to just show the whole post.
this works nice, but I wanted no summarization for
{{ if .Truncated}}
{{ .Summary }}
<p><i>(<a href="{{ .RelPermalink }}">Read More</a>)</i></p>
{{ else }}
{{ .Content | safeHTML }}
{{- end -}}
{{- if .Params.linkurl -}}
<p><a href="{{ .RelPermalink }}"><i class="fas fa-level-down-alt fa-xs"></i> Permalink</a></p>
{{- end -}}
and setting the summary limit to infinite.
What this does is:
.Truncated, return its summary. This means that the POST IS TRUNCATED ONLY IF I MANUALLY ADD THE MORE TAG, because the auto-summary limit is set to a big number.safeHTML is prolly not needed there but whatever.When downloading a Google Colab (and prolly a classic Jupyter Notebook) as .py it preserves the plain-text cells as python comments!
From No more disk space: How can I find what is taking up the space? - Ask Ubuntu, run this as root:
du -cha --max-depth=1 | grep -E "M|G"
The grep is to limit the returning lines to those which return with values in the Megabyte or Gigabyte range.
Next one would be /var etc.
Then there’s ncdu and friends too.
From SO’s credentials - How can I save username and password in Git? - Stack Overflow:
git config --global credential.helper store
Then on the next git pull the credentials entered will be saved in plain text on disk.
Wow. WOW.
Wrote a program accepting a LONG --yes_delete_all_data_completely, without a short version, to make sure no one does an error and deletes everything.
Today I mistyped a --y parameter, it started in the mode above.
Then I learned that argparse does prefix matching.
python - How to share global variables between tests? - Stack Overflow:
import pytest
def pytest_configure():
pytest.my_symbol = MySymbol()
allows then to use pytest.my_symbol elsewhere, it’s a part of global pytest namespace now.
That said, fixtures are still the preferred way it seems (todo - how are they shared between files?)
Playing with
Spacy and it’s as nice and I thought it’d be.
Interesting bits and general dump of first impressions:
Doc and Span are heavily token-based, including for NER stuff. Can’t set a sub-token entity, for example.Doc.char_span() supports creating a Span based on characters and various alignment methods! Doc · spaCy API Documentation
Example class for individual training instances can do neat stuff with BIO mapping, aligning of NER tokens etc: Example · spaCy API DocumentationWhen writing a function requiring a --yes_I_know_what_this_means_delete_everything and writing a warning message with tens of exclamation points, I decided that ASCII art is the better way to go.
Found this: Caution Text Art (Copy & Paste) - textart.sh
Allows even changing backgrounds from spaces to _s etc.!
textart.sh has a lot of topics and allows basic customisation of the arts themselves.
(Can’t find a single ASCII art piece with an artists’ signature though, which kinda worries me. And the dynamic scrolling without a way to see a list of all results…)
“pic"related:
░░░░
██
██░░██
░░ ░░ ██░░░░░░██ ░░░░
██░░░░░░░░░░██
██░░░░░░░░░░██
██░░░░░░░░░░░░░░██
██░░░░░░██████░░░░░░██
██░░░░░░██████░░░░░░██
██░░░░░░░░██████░░░░░░░░██
██░░░░░░░░██████░░░░░░░░██
██░░░░░░░░░░██████░░░░░░░░░░██
██░░░░░░░░░░░░██████░░░░░░░░░░░░██
██░░░░░░░░░░░░██████░░░░░░░░░░░░██
██░░░░░░░░░░░░░░██████░░░░░░░░░░░░░░██
██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██
██░░░░░░░░░░░░░░░░██████░░░░░░░░░░░░░░░░██
██░░░░░░░░░░░░░░░░██████░░░░░░░░░░░░░░░░██
██░░░░░░░░░░░░░░░░░░██████░░░░░░░░░░░░░░░░░░██
░░ ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██
██████████████████████████████████████████
░░
Okay, this blew my mind. Taskwarrior can have lowercase +t tags, along with the +T-uppercase ones I’ve been using my entire life.
Wow.