@sergi@floss.social
@sergi@floss.social avatar

sergi

@sergi@floss.social

🐍 Python aficionado
🕸 Web dev tinkerer
🎲🕹 Gaming enthusiast
🗣 English, Catalan, Spanish, Italian

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

sergi, to keyboard
@sergi@floss.social avatar

What do you folks use nowadays to measure typing speed?

sergi, to books
@sergi@floss.social avatar

I just requested a book from the San Francisco Public library to be delivered to the San Diego Public Library branch close to me, all for free, and I think this is amazing.

sergi, to firefox
@sergi@floss.social avatar

Seeing this on 2024 is a joke.

aral, to cooking
@aral@mastodon.ar.al avatar

🔥 PSA for men who cook: After you chop a chili pepper do not – I repeat, do not – go for a pee without washing your hands like your life depends on it.

Don’t ask me how I know. Just trust me when I say chilis and penises do not mix and this is definitely not the kind of fire you want in your pants.

Ow.

sergi,
@sergi@floss.social avatar

@aral what a hot take...

nutjob4life, to random
@nutjob4life@fosstodon.org avatar

ME: Whatever you do, do not tell mom

DAUGHTER: Got it

[later]

MOM: Have a good time at the park?

DAUGHTER: [loudly] Dad definitely did not get into a fight with a goose

sergi,
@sergi@floss.social avatar

@nutjob4life

MOM: Pics or didn't happen.

sergi, to python
@sergi@floss.social avatar

New post: Speed up Python dictionary lookups

You can "intern" strings to improve performance of dictionary lookups, but using them is not as straightforward as one can think.

https://sergiswriting.com/python-sys-intern/

sergi, to python
@sergi@floss.social avatar

A Deep Dive Into Python's functools.wraps Decorator
https://jacobpadilla.com/articles/Functools-Deep-Dive

glyph, (edited ) to random
@glyph@mastodon.social avatar

OK, so the Vision Pro has pre-order & release dates. Are you planning to buy one?

sergi,
@sergi@floss.social avatar

@glyph missing option: I didn't know what Vision Pro was.

sergi, to Bash
@sergi@floss.social avatar
sergi, to blogging
@sergi@floss.social avatar

I want to hear what you folks use to sync blogs/webpages over SFTP.

So, the setup is that you have a bunch of files (HTML, CSS, etc) on your local computer, and you want to update your hosting with the latest version, having only SFTP access.

I am mounting it locally with sshfs and then using "rsync -vuz --delete --recursive <source> <destination>", but I feel like there is a better way (or better rsync options).

sergi, to random
@sergi@floss.social avatar
hi_mayank, to random
@hi_mayank@hachyderm.io avatar

declarative shadow dom is coming to firefox very soon and i have a blog post lined up already 👀

sergi,
@sergi@floss.social avatar

@hi_mayank I just checked your mastodon profile and I don't see a link to a blog. When you said post did you mean here?

sergi,
@sergi@floss.social avatar

@hi_mayank I meant that it was not clear to me if you were going to post on a blog, so I checked your profile to see if you had one.

Because you don't, I'm guessing you are going to post this write up as a thread in here instead than on a blog?

mo8it, to random
@mo8it@fosstodon.org avatar

I migrated my containers to use instead of generating Systemd files (deprecated)

I really love it 😃

Finally, we have an alternative to compose! And in my opinion, it is even better and more flexible 🚀

Anyone interested in a blog post?

sergi,
@sergi@floss.social avatar

@mo8it yes please!

sergi, (edited ) to random
@sergi@floss.social avatar

I would like to hear from people using screen readers. Do you prefer the hashtags to be intermingled in the body of the message, or separately at the end?

Example of the former:

"I did a and after doing I was happy"

Example of the latter: this post 😉

Please boost.

sergi,
@sergi@floss.social avatar

@toolsontech good point. I'm not sure how editing the original post would impact the results (does it reset it?), so I'll post a reply with the results at the end of it.

sergi,
@sergi@floss.social avatar

For anybody interested in the results that didn't vote, the poll ended with:

31% Hastags in the body
69% Hastags at the end

51 people voted

@toolsontech

sergi, to ubuntu
@sergi@floss.social avatar
alexdeathway, to python
@alexdeathway@fosstodon.org avatar

Hey devs, I am working on a project that requires restricting a API from public access, but data generated from API needs to be made available to clients. So, came up with this workflow, what do you all suggest?

sergi,
@sergi@floss.social avatar

@alexdeathway why not add authorization to FastAPI itself?

sergi, to solar
@sergi@floss.social avatar
gerrymcgovern, to random
@gerrymcgovern@mastodon.green avatar

"Going electric does not solve our problems, it only deepens them. We’ve known for a long time that our GDP addiction and capitalist economic model are incompatible with life on Earth. Scientists kept saying that for decades, yet very little happened."

Not only does electrification "not help — it worsens the situation, and yet we keep heading towards a disaster."

We don't have an energy production problem.
We have an energy consumption problem.
We consume too much.

https://www.euronews.com/next/2023/12/26/we-cant-save-the-world-with-electric-cars

sergi,
@sergi@floss.social avatar

@gerrymcgovern @accretionist unfortunately, currently is more a "few can" than a "many can". And these "few" are probably the richer ones.

davidshq, to fun
@davidshq@hachyderm.io avatar

I've been thinking I need a side project for when I'm not feeling working on big things. I have the source for a few old I've hacked on a few times.

The games were written in (and it's predecessors) and in the past I've used to get them running natively on Windows....

Now I'm thinking of using an (e.g. like that powering ) to translate the code into a modern language.

1/2

sergi,
@sergi@floss.social avatar

@davidshq check out Godot. If you are proficient with C++, you can use that instead of their scripting language.

ubernostrum, to python

Today's post in my and "Advent calendar" series covers Python's "property" helper, what it's for, and why you should almost never use it:

https://www.b-list.org/weblog/2023/dec/21/dont-use-python-property/

sergi,
@sergi@floss.social avatar

@ubernostrum I don't agree with such a generic advice.

When I have made a property, is because I deliberately want the data access/setting to work like an attribute, not as two separate methods. I want the users of that object to be able to use getattr/setattr, plus the benefit of a cleaner API (a = x.foo and x.foo = a vs a.get_foo() and x.set_foo(a)).

If the hidden logic is very expensive, then yes, I might signal that with methods, but is more the exception than the norm.

pamelafox, to random
@pamelafox@fosstodon.org avatar

I've made progress in my quest to document my native California garden. After my prototype successfully withstood the storm, I made 20 laminated signs on landscape staples. Now anyone walking by can instantly identify plants they might want in their own garden! ❤️🪻

Photo of garden with multiple signs next to plants

sergi,
@sergi@floss.social avatar

@pamelafox this is great! From the post it seems you handcrafted them from materials instead of buying an off-the-shelf solution. How did you make them?

Lee_Holmes, to random

Yikes. Postman recently pivoted to store all of your session data (including authentication tokens etc.) in their Cloud Service, which you can fully browse and explore in their online tool.

Their security page makes it clear that they have not considered the Okta-style risks associated with this change. If your company has any devs using Postman for production testing, I would strongly recommend Insomnia: https://insomnia.rest/, and then consider any credentials stored in Postman history to be at risk and should be rotated.

sergi,
@sergi@floss.social avatar

@Lee_Holmes and it has the great side effect that if you don't have an internet connection, all your collections and environments will not load.

I found that one day I wanted to debug stuff running on my local machine while having no Internet.

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