Nikita
Needed to implement a quick draft of a website, which basically pulls data from an API and displays it neatly on the page. For some reason, I decided to make it a #JavaScript SPA. Immediately regretted it due to no built-in parsing of dates and 0-indexed months 🙄 Rewriting it as a thin client with a lightweight #Python (or #Go, I haven’t decided yet) back-end. Good morning! :blobcatgooglycofecup:
Nikita
For those, who wonder: No, my SPA is not a thin client, it can be thinner! The API accepts date as parameter, and I want for the client users to ba able to put the desired date as a query parameter. Such a pain in the butt to do this in JS, so my website will be static — even better.
Nikita
TIL: `man ascii` to show the ASCII table :blobcatopenmouth:
Show previous comments
Nikita
SSH commit signing has been around for over 7 months now, but GitHub is still behind on that feature (unlike @gitea and thus @codeberg) Yet another reason to #GiveUpGitHub
Nikita
#Django devs, I need your help! Is there a way to display a model object’s data in a ModelForm as an uneditable field? Use case: User A submits an order for User B to execute. On creation time, User A can choose an executor. User B can edit the order submitted to him, but can’t edit the ‘executor’ field any more. I do still want to show it in the HTML form, though. Is there a way to cleanly implement it with ModelForm? Plz boost because I’ve been sitting at this for two hours now 😩
Show previous comments
Brian :fedora: :python:
@kytta If I understand your problem correctly, you could inject arbitrary HTML key value pairs via the widget attrs property in the ModelForm or add a conditional check that if an order exists in the form template disable the widget? Sorta like this: {% if obj %}
Anthony Sorace
@kytta @ru (I have not done this particular case myself, but…) You can define attrs on a widget; I *think* this is just a question of setting the “readonly” attr on the one in question. Note that you’ll likely want to validate that field server side on submission to guard against folks editing the html directly.
Nikita
I would never imagine that picking apart old #legacy code would be a fun activity for me. But now, having replaced 30+ lines of unprofessionally written jQuery mess with two lines of backend Python code, I feel so euphoric. Took me an hour to even get the sense behind it, but it’s rewarding. I guess I definitely chose the right profession 😄
Finner
@kytta my primary function in my day job is reading and understanding old messy programming in sometimes obsolete controls systems and reprogramming those functions in newer controls systems using modern standards. I really enjoy it, so I know what you mean. It can be fun and quite satisfying.
Nikita
Me: *run a single MariaDB container* Docker: *eats 4GB* I hate Docker Desktop so much :blobcatangery:
Nikita
Quite sad that this is the first time in my life that I've encountered a website that actually does respect DNT 😕
Григорий Клюшников
Medium also respects it somewhat. They'll track the crap out of you themselves, but won't show youtube embeds to "protect your privacy" 🤡
Nikita
When developing a web app locally, which credentials do you use for testing? Anonymous poll
Poll
user[name]/pass[word]
2
22.2%
admin/admin
5
55.6%
root/toor
1
11.1%
other (reply)
9 people voted. 1
11.1%
Voting ended 23 Jun 2022 at 15:07.
Nikita
TIL that the HTML attribute ‘bgcolor’ with the value ‘crap’ produces a brown-ish background on the element. There is a bizarre algorithm behind it, which is shipped with every browser because of, you guessed it, compatibility with Netscape Navigator. https://stackoverflow.com/questions/8318911/why-does-html-think-chucknorris-is-a-color
Nikita
#AskFedi iPhone users: P. S. Please no "apple bad" replies :D
Show previous comments
𝓡𝓾𝓭𝓸𝓵𝓯 🇺🇦 :unverified:
@kytta
Nikita
Hey Fedi, do you know if there is a federated (perhaps even #ActivityPub-powered) cooking recipe hosting service? If not, let's 👏 make 👏 this 👏 happen! I hate modern recipe websites. All of them are full with ads and tracking. The leading recipe hosting in my country loads over 30 different trackers, and that's excluding the ads!
Show previous comments
DELETED
@kytta In French, there's https://www.cuisine-libre.org/ which is quite good. I know there's a Nextcloud app for that: https://apps.nextcloud.com/apps/cookbook But it is not federated.
Nikita
Yesterday I had the joy of installing Fedora (dual-boot) on my work PC. And oh boy, did Linux come a long way! First, I don’t quite understand why people dislike the Fedora installer. All went pretty smooth, and the installer immediately recognized my free space and created the needed partitions. GRUB also plays pretty good with Windows.
Nikita
Second, I think I’m in love with GNOME 40+. The snappiness, the style, the default app set are incredible. I was amazed how I literally didn’t have to install anything extra to do my job (which, to be fair, is basically RDP’ing into Windows machines and connecting to SMB shares).
Nikita
I have used up all my data plan for this month, so my speed is capped at 64 Kbps. This is a friendly reminder to all web developers: Keep your bundle sizes small, only ship what you need, compress your images, YOU DON'T NEED REACT IN YOUR F-ING BLOG, test your sites on slow connections and slow phones. You using a Galaxy S22 Ultra with an unlimited 5G plan doesn't mean everyone else does too.
Show previous comments
[DATA EXPUNGED]
Nikita
#Django advice needed! My setup is: I have 5 Django apps, each has 3–7 models. For each model, there is a list and a create/edit view. All are based on the same base.html. I want to have <title> be set in a LIFO manner. For example, list of ‘items’ inside ‘warehouse’ app would have the title ‘Items - Warehouse - Site name’. Right now I have to create almost identical base templates with just the title block for every app. Is there a less repetitive way?
Paul :python: :django:
Ru (Tech) :blobcatsadlife:
@kytta I’ve actually been using blocks as well at the moment. I haven’t cared to optimise this as I haven’t felt the need.
Nikita
How do you organize your files, Fediverse? I have accumulated lots of stuff over the years: photos and videos, school and university documents, job files, private development projects, video projects, music, screenshots — all of which I want to keep backed up. The problem I have is the directory structure. How would you organize all this so that stuff is always easy to find and duplicates won’t spawn? I’ve tried Johnny.Decimal, and it didn’t work for me. Do you have other ideas? #AskFedi
Show previous comments
Tagomago
-Docs (personal) Then mostly by topic/project and/or chronologically named directories inside. Johnny Decimal looks too rigid to stick to it. Maybe it works for personal files or abstract, administrative/managerial positions. Most projects comprise several kinds of files, and sometimes a high number of them, so I put those into different directories inside the project directory. Otherwise there would be pools of files, and I don't want that.
asriyanarthur
@kytta
bojkotiMalbona
@kytta This question is really 2 in 1. How the data is organized and how it is stored/archived. W.r.t media, you’re aware of the lifetime limitations of optical media & flash media. So you’re using a hard drive to store your backups. Backup tech has become a sad state of affairs. Hard drives are cheaper than cassette tapes, but they have moving parts… heads that can crash. Not ideal. |
@kytta From what I understand of Apple, is that they're very much against any backend tweaks. As far as browser engine and dns server. So I doubt it, via extrapolation
@kytta not that I know of, but for that problem specifically maybe you can turn off automatic updates