@ehmatthes@fosstodon.org
@ehmatthes@fosstodon.org avatar

ehmatthes

@ehmatthes@fosstodon.org

Author, teacher, programmer, outdoor guy · ehmatthes.com · Python Crash Course · django-simple-deploy

This profile is from a federated server and may be incomplete. Browse more on the original instance.

ehmatthes, to random
@ehmatthes@fosstodon.org avatar

I haven't backed up virtual environments in quite some time. Apparently my habits weren't so good ~15 years ago.

ehmatthes, to python
@ehmatthes@fosstodon.org avatar

Django from first principles, part 8 is out. This installment adds styling to the blogs page, and discusses how static files are managed in Django.

https://www.mostlypython.com/django-from-first-principles-part-8/

danielfeldroy, to random
@danielfeldroy@fosstodon.org avatar

Naming things is hard.

ehmatthes,
@ehmatthes@fosstodon.org avatar

@danielfeldroy I've heard that before.

ehmatthes, to python
@ehmatthes@fosstodon.org avatar

I updated simple_deploy's test suite to use uv if it's available, and fall back to pip if uv isn't available.

A uv-enabled run takes about 17.5s on my main system. A pip-based run takes about 45s.

On my Windows VM, a uv-enabled run takes about 55s. A pip-based run takes 175s.

#Python #Django

ehmatthes, to random
@ehmatthes@fosstodon.org avatar

Moving from an island in AK to the lower 48 means going through everything in the house.

This was one of the 1980s ways to pretend that kids didn't learn to curse by listening to their parents. Note from the future: it didn't work.

ehmatthes,
@ehmatthes@fosstodon.org avatar

@AlSweigart This incident is burned in my memory in a way that made me so much more inclined to cursing.

I called a neighbor a fucking idiot, and that was a pretty accurate statement. I had to write this 500 times, but a week later my twin brother did the same thing, and he only had to write "I will not swear" 100 times.

But it's okay, I'm sure my kid will grow up to tell his own version of this kind of thing from my definitely not perfect parenting.

ehmatthes, to random
@ehmatthes@fosstodon.org avatar

Lots of cleaning house these days in preparation for our cross-country move next month.

Stickers used to be so much bigger! Left, laptop ca 2014. Right, laptop 2024.

jeremymorrell, to random
@jeremymorrell@hachyderm.io avatar

My 5 year old made the shh 🤫 and then mewing gestures at me and

  1. Thank you tiktok middle school teachers 🙏
  2. Holy hell it was adorable
ehmatthes,
@ehmatthes@fosstodon.org avatar

@jeremymorrell When I flew to Pittsburgh last month I sent my 13yo son a picture of Ohio from the plane. He was not expecting it to look so nice.

ehmatthes, to random
@ehmatthes@fosstodon.org avatar

I had a pretty sweet parenting/author moment this weekend. My 13yo son has finally shown interest in programming, so we've been working through a few small projects together

I've been encouraging him to look through certain sections of my book, not to avoid having to show him everything but to give him a little independence in his learning pace. Also, I've been encouraging him to do exercises because writing a bunch of tiny programs is so good for learning.

ehmatthes,
@ehmatthes@fosstodon.org avatar

He finally started reading one of the sections. Some time later he found me outside to say, "Hey dad your book is so well written! Every time I had a question about something you answered it in the next sentence, or the next paragraph."

He was really impressed, and understood for the first time why the book has done so well.

That was a really nice feeling, especially with this dedication that's been in the book for almost ten years now:

ehmatthes,
@ehmatthes@fosstodon.org avatar

@unicycle There have been lots of "I know there's a good book about Python somewhere around here" jokes over the years. :)

buttondown, to random
@buttondown@mastodon.social avatar
ehmatthes,
@ehmatthes@fosstodon.org avatar

@buttondown Yes yes yes! I'd love to hear more about how you went about implementing this.

We've heard for so long that code blocks in emails can't be highlighted because email clients are limited. That has seemed unfounded, and I've implemented it for my own newsletter on Ghost.

How did you decide to make this happen when other platforms say email clients can't support it?

ehmatthes,
@ehmatthes@fosstodon.org avatar

@buttondown Well, I wouldn't be surprised if it's that simple. Most platforms just haven't seemed to prioritize technical writing.

When I dug into the internals of emails that were actually sent by a variety of platforms, I found plenty of CSS to support other features. It didn't take much more to support highlighting.

If you don't mind my asking, did you find a few clients that don't handle it well? I don't have access to good email client testing tools.

ehmatthes,
@ehmatthes@fosstodon.org avatar

@buttondown BTW I really hope you see some technical writers migrate from Substack for this feature alone. I shared this update in a technical writers group I'm part of.

I haven't heard any complaints from my own subscribers, but I have heard from a number of people that highlighted code blocks really do make posts more readable. I included support for highlighted lines and filenames, which is really helpful for writing about code as well.

ehmatthes,
@ehmatthes@fosstodon.org avatar

@buttondown I'm on a managed instance of Ghost, so I don't have access to source.

I wrote a script that grabs a draft post through the API, parses the post, recognizes an ### hl-lines=[] directive at the beginning of the code block, uses Pygments for syntax highlighting, then adds a custom style to each highlighted line. It then pushes a new version of the draft back to the server.

I'm hoping to make time to release it as a public extension to Ghost (integration).

ehmatthes,
@ehmatthes@fosstodon.org avatar

@buttondown BTW I'd love to see you implement this as well. It's no more difficult than syntax highlighting, adds little weight to emails, should be broadly supported by clients, and makes a world of difference when writing about code.

ehmatthes,
@ehmatthes@fosstodon.org avatar

@buttondown This is fantastic! Will you support ranges? ie

hl_lines="3 5-7 10"

ehmatthes,
@ehmatthes@fosstodon.org avatar

@buttondown PS now do filenames!

ehmatthes,
@ehmatthes@fosstodon.org avatar

@buttondown A lot of the examples we see about code blocks just show a snippet, without any context. But when you're actually writing about code, you're often showing a section of a longer file.

In these real-world contexts, it can be really helpful to see what file the code block refers to. It's much nicer to have the code block labeled than to always have to explain in text "This excerpt from models.py..."

excerpt from a newsletter post with a close block labeled "blogmaker_lite.py"

ehmatthes,
@ehmatthes@fosstodon.org avatar

@buttondown It also means readers can skim a longer post, and see which files are being discussed.

I've also seen them placed like this:

ehmatthes, to django
@ehmatthes@fosstodon.org avatar

django-simple-deploy 0.6.5 is out.

This solidifies support for Platform.sh; multiple deployments should work, and it should work if you have multiple orgs as well.

Now the work shifts to implementing an internal plugin model. I'm really looking forward to this phase of work. :)

https://github.com/ehmatthes/django-simple-deploy/blob/main/CHANGELOG.md

#Django #Python

ehmatthes,
@ehmatthes@fosstodon.org avatar

For anyone curious to follow, this is the main issue tracking plugin work:

https://github.com/ehmatthes/django-simple-deploy/issues/313

josh, (edited ) to random
@josh@josh.tel avatar

Hey folks! I'm looking for examples of elected officials and people running for office who have accounts on the fediverse.

Know of one? Please let me know! Boosts appreciated :boost_requested:

#USPol #CanPoli #UKPol

ehmatthes,
@ehmatthes@fosstodon.org avatar

@josh I'm hopeful that @sarahtaber will be successful in her campaign for Commissioner of Agriculture in NC.

djangochat, to random
@djangochat@fosstodon.org avatar

Ep164: Buttondown with Justin Duke is live!

Justin is the founder of Buttondown, a newsletter service built with Django. We discuss scaling the code, and the team behind the project, the email space in general, new developments in web development, and Django features he’d like to see.

https://djangochat.com/episodes/buttondown-justin-duke-Si2kolaE

ehmatthes,
@ehmatthes@fosstodon.org avatar

@djangochat I love that you take summers off. I always want good podcasts to be sustainable for the hosts.

Enjoy the break!

ehmatthes, to random
@ehmatthes@fosstodon.org avatar

I really enjoyed the recent @djangonews conversation with @webology. Jeff, you can repeat that line about wanting to see "decades of over-investment in open source" as many times as you want.

https://djangochat.com/episodes/funding-open-source-jeff-triplett

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • megavids
  • GTA5RPClips
  • tacticalgear
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • ethstaker
  • anitta
  • provamag3
  • Leos
  • cisconetworking
  • lostlight
  • All magazines