Searching yarn

Twts matching #coding
Sort by: Newest, Oldest, Most Relevant
In-reply-to » Heute fahren wir auffe Arbeit ein großen Update für das CMS der zentralen Webseiten. Hoffentlich geht das alles gut. 😱

@arne@uplegger.eu Ohjemine, TYPO3! O_o Lass mich schreiend davonlaufen!

Mit dieser absoluten Katastrophensoftware vor dem Herrn haben wir mal ein Studienprojekt gemacht. Die hat alle Vorurteile komplett übererfüllt. Angefangen von Fehlerseiten, die statt 4xx oder dergleichen immer mit HTTP 200 ausgeliefert wurden oder auch, dass das generierte HTML leider einfach ungültig war. Über die Implementierung von Löschen durch einen Deleted-Schalter in der Datenbank, das Speichern von Passwörtern im Klartext bis hin zu völlig umständlichen Bedienungskonzepten. Alles hat immer brutal viele Schritte gebraucht. Das Zeilennummernrumgeeier im TYPO-Script erinnerte eher an Basic. Uns kam es auch so vor, als ob man damit nicht ernsthaft was sinnvolles machen könnte.

Zu allem Überfluss hatte irgendwer noch ein ganz hundsmiserables Buch ausgegraben, das als Vorbereitung dienen sollte. Ich kann mich zum Glück weder an den Titel noch den Autor erinnern, aber ich weiß noch, wie das komplett inkonsistent geschrieben war. Anfangs gabs mehrere Seiten zu Unicode und UTF-8 wurde angepriesen, aber alle Beispiele haben dann auf ISO-8859-1 gesetzt. Gezeigter Beispielcode war hƤufig unterste Schublade. Selten hab ich so merkwürdige ErklƤrungen gelesen: ā€žWenn Sie die Sicherheitswarnhinweise stƶren, kommentieren Sie doch bitte im Quelltext die die()-Funktion in $ZEILE aus.ā€œ Oder ein anderer Klassiker: ā€žAusgeschrieben würde der Code wohl folgendes tunā€¦ā€œ. War sich der Autor also nicht ganz sicher, ob sein Codeschnipsel vllt. doch in Wahrheit was ganz anderes tut.

Seit diesem gigantischen Trauma (das hat mich wirklich sehr nachhaltig geprƤgt, wie man Dinge nicht machen sollte) hab ich erfolgreich einen Bogen um das TYPO3-Universum gemacht.

Ich kann nur hoffen, dass es zwischenzeitlich ein wenig besser geworden ist. Aber Deinem Kurzbericht zufolge scheint da ja immer noch der Wurm drin zu sein. Mein Beileid! :-(

⤋ Read More
In-reply-to » I want to propose my own counter-proposal to the discussion that's ongoing with Go and error handling.

If people just wrote error free code to begin with, there would be no need for error handling! :-P

No, honestly, I don’t think that there is anything wrong with the current approach. I don’t see any wins of any of the proposals I’ve come across.

⤋ Read More

For many years I have found Flask to be too basic a tool for modern development. But since I create APIs using Flask with Pydantic to validate the input data, some middlewares for parsing and Blueprint to separate the code into modules… I must admit that I am super comfortable, fast and easy to test.
#flask #python #pydantic

⤋ Read More
In-reply-to » I share a simple API template with Clean Architecture using #flask and #fastapi https://git.andros.dev/andros/api-template-with-clean-architecture #cleancode #cleanarchitecture

What is clean architecture? That’s a good question.

You think of a pattern for ordering code with good decisions isolating technologies (you can change the web framework or database without break the business logic), easy to test (you only test interfaces and use cases), sharing code between frameworks (entities and use cases), scalability, modulations and standardizing names. Clean architecture is not perfect, it has a learning curve and some abstraction in each technology. You can even find rejection with yours colleagues.
I have a good article on this topic.
https://programadorwebvalencia.com/implementando-arquitectura-limpia-en-python/
#python

⤋ Read More
In-reply-to » this is epic https://lmnt.me/blog/how-to-make-a-damn-website.html

@kat@yarn.girlonthemoon.xyz I approve! That’s how I learned HTML (version 4 at the time and XHTML shortly after) and making websites, too. Some of them are still made like this to this day. Hand-written HTML. Hardly any <div> and class nonsense. I can’t remember with which editor I started out with, but I upgraded to Webweaver (later renamed to Webcraft) quickly. Yeah, this were the times when there was just a single computer for the whole family.

Free hosting on Arcor, Freenet and I don’t know anymore how they were all called. Like this author, I uploaded everything via FTP. Oh dear, when was the last time I used that? And I had registered plenty of free .de.vu domains.

Being on Windows at the time, everything was ISO-8859-1 for me. No UTF-8, I don’t think I’ve heard about it back then.

Later, I wrote my own CMSes in PHP. Man, were they bad in retrospect. :-D Of course, MySQL databases were used as backends. I still exactly know the moment I read the first time about SQL injections. I tried it on my own CMS login and was shocked when I could just break in. The very next thing I did was to lock down everything with an .htaccess until I actually fixed my broken PHP code. Hahaha, good memories.

I swear by Atom or RSS feeds. Many of my sites offer them. I daily consume feeds, they’re just great.

⤋ Read More
In-reply-to » Another infrastructure apocalypse day at work. Linux and Windows users were unable to reach M$ services. No Outlook, no Teams, no intranet (Sharepoint), no Azure, etc. Mac users were lucky, though. Took whoever the whole day to resolve that. Shortly before I called it quits, it worked again. I haven't read any e-mail today, used Teams mostly on the company phone, but it's the plague.

@movq@www.uninformativ.de Yes, exactly that. It’s awful! And it’s getting worse from my perspective. Nobody in charge is ever gonna learn anything. I figure we just fully deserve this M$ crap, every single bit. :-(

Luckily, the most important development platform still worked for me, so I could actually do something, review code, pull and push, etc. But the calls with the screenshares were nightmares. Can’t see shit on such a tiny display with today’s extreme monitor sizes people use. Looking at logs, hahahahahahaaa…

⤋ Read More

I’m refactoring (mangling four lines of of code with assignments into one function call) and man, do I love vim macros! Such a bloody amazing invention. Saves me heaps of manual labor.

⤋ Read More
In-reply-to » @kat To improve you shell programming skills, I highly recommend to check out shellcheck: https://github.com/koalaman/shellcheck It points out common errors and gives some suggestions on how to improve the code. Some details in shell scripting are very tricky to get right at first. Even after decades of shell programming, I run into "corner cases" every now and then.

PSA: Yarnd operators might want to define code { white-space: pre } in their CSS themes to render things as they’re supposed to look like.

⤋ Read More
In-reply-to » been playing with making fun scripts using charm CLI's gum library :P

@kat@yarn.girlonthemoon.xyz To improve you shell programming skills, I highly recommend to check out shellcheck: https://github.com/koalaman/shellcheck It points out common errors and gives some suggestions on how to improve the code. Some details in shell scripting are very tricky to get right at first. Even after decades of shell programming, I run into ā€œcorner casesā€ every now and then.

E.g. in getlyr’s line 7 it warns:

echo -e $(gum style --italic --foreground "#f4b8e4" "'$artist', '$song'")
        ^-- SC2046: Quote this to prevent word splitting.

For more information:
  https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt...

Most likely not all that problematic in this application, but it’s good to know about this underlying concept. Word splitting is basically splitting tokens on whitespace, this can lead to interesting consequences as illustrated by this little code:

$ echo $(echo "Hello   World")
Hello World

$ echo "$(echo "Hello   World")" 
Hello   World

In the first case the shells sees two whitespace-separated tokens or arguments for the echo command. This basically becomes echo Hello World. So, echo joins them by a single space. In the second one it sees one argument for the echo command, so echo simply echos this single argument that contains three spaces.

⤋ Read More

The editor can launch a new shell now:

https://movq.de/v/6ec68b50dd/los86-edit-shell.mp4

Trivial to implement but super useful. It allows for simple but meaningful dev cycles: Edit source code, run/test it, back to editor. That’s what I do in the video.

(The Brainfuck program is silly, but I got nothing else at the moment.)

The I/O cache is also getting better. All that back and forth doesn’t hit the disk at all, once cached.

This whole thing is much more fun and interesting when you run it from a real floppy disk. It’s a 5.25ā€ floppy in the video (so it’s actually floppy šŸ˜…). Disk seek times can be catastrophic and you don’t notice any of this on modern disks.

⤋ Read More
In-reply-to » I'm still making progress with the Emacs client. I'm proud to say that the code that is responsible for reading the feeds is almost finished, including: Twt Hash Extension, Twt Subject Extension, Multiline Extension and Metadata Extension. I'm fine-tuning some tests and will soon do the first buffer that displays the twts.

Thanks šŸ˜€! @aelaraji@aelaraji.com I am working on a fork now because the new version will break the current code. Therefore, I will upgrade the current repository (https://codeberg.org/deadblackclover/twtxt-el). The original author is helping me with reviews. I am sorry for my long development, I am working in my free time and it is scarce. I will report back to you all. šŸ˜‹

⤋ Read More

StackExchange/dnscontrol: Infrastructure as code for DNS! šŸ‘ˆšŸ‘ˆ Now this looks might interesting… I might look into this for managing my own domains and DNS. I note that my current registrar isn’t on the list of supported registrars, oh well, I don’t like OnlyDomainsā„¢ much anyway. Anyone familiar with these regisrars?

  • AWS Route 53
  • CSC Global
  • CentralNic Reseller (formerly RRPProxy)
  • DNSOVERHTTPS
  • Dzynadot
  • easyname
  • Gandi
  • HEXONET
  • hosting.de
  • Internet.bs
  • INWX
  • Namecheap
  • Name.com
  • OpenSRS
  • OVH
  • Realtime Register

⤋ Read More

I’m still making progress with the Emacs client. I’m proud to say that the code that is responsible for reading the feeds is almost finished, including: Twt Hash Extension, Twt Subject Extension, Multiline Extension and Metadata Extension. I’m fine-tuning some tests and will soon do the first buffer that displays the twts.

⤋ Read More
In-reply-to » just spent like half an hour finding a terminal based color picker that would just. turn the cursor into a cross hair and let me pick from the screen. in linux fashion this was somehow difficult

@kat@yarn.girlonthemoon.xyz i wound up with xcolor AND pastel at the same time, because xcolor does exactly what i want while pastel and its picker subcommand does the same thing, relying on xcolor, but brings up a nice graphic of the picked color and related colors, plus more than just the hex code. neat.

⤋ Read More
In-reply-to » Any idea What's this "twtxtfeevalidator/0.0.1" UA about? I thought I could ask before throwing a 1000GB file at it 🪤 could it be the same 'xt' thing @lyse was talking about the other day?

I cobbled that together yesterday, @aelaraji@aelaraji.com. Since I was too lazy to write some tests, I simply hit your feed as I knew it contains two invalid lines right now. Sorry mate! :-( Next thing is to actually write some proper tests, improve the messages, etc.

Here’s the code: https://git.mills.io/yarnsocial/validator

Looking forward to that, @prologic@twtxt.net. :-)

⤋ Read More

How in da fuq do you actually make these fucking useless AI bots go way?

proxy-1:~# jq '. | select(.request.remote_ip=="4.227.36.76")' /var/log/caddy/access/mills.io.log | jq -s '. | last' | caddy-log-formatter -
4.227.36.76 - [2025-01-05 04:05:43.971 +0000] "GET /external?aff-QNAXWV=&f=mediaonly&f=noreplies&nick=g1n&uri=https%3A%2F%2Fmy-hero-ultra-impact-codes.linegames.org HTTP/2.0" 0 0
proxy-1:~# date
Sun Jan  5 04:05:49 UTC 2025

😱

⤋ Read More
In-reply-to » @movq How about now? šŸ™

@movq@www.uninformativ.de That’s so damn cool mate! I went through the code, but this lowlevel stuff is really not my favorite cup of tea. Having said that, it was actually really nice to see the abstractions and APIs work together and how things are getting indeed very readable in the userland programs. That’s easy to track in this extremely tiny OS implementation. Excellent work, keep on hacking!

Now, you just have to quickly add a network stack and then can write a twtxt client for it! ]:->

⤋ Read More

i’ve transitioned text editors from nano (yeah i know) to micro and god micro is just so much better i did not know there was a CLI text editor i could use with sensible keyboard shortcuts that did not leave me feeling like i’m typing nuclear codes to do simple tasks like saving and editing

⤋ Read More

Okay, this is pretty cool. My 8086 toy OS running on my old Pentium from an actual floppy disk. šŸ˜ I just love that sound and the feeling of using floppies. This brings back so many memories from my early DOS days.

The cp-unopt program copies a file and intentionally uses small unaligned reads/writes (hopefully triggers more bugs).

The I/O cache works ā€œokay-ishā€, I guess. When sha1 runs, it has to do a few reads for the first file and basically none for the second one. Both could have been served entirely from the cache, theoretically. (But even just having an I/O cache in the first place speeds up things dramatically.)

Notice how there’s an EA file. That’s a left-over from OS/2, because I copied some files to the floppy using OS/2. In other words, my FAT12 implementation survives OS/2 writing to it. 🄳 (But I guess it should show up as EA DATA.SF. My current code starts at the left and stops at the first space.)

https://movq.de/v/d4d50d3c74/los86-on-p133-from-floppy-small2.mp4

⤋ Read More

I’ve been making a little toy operating system for the 8086 in the last few days. Now that was a lot of fun!

I don’t plan on making that code public. This is purely a learning project for myself. I think going for real-mode 8086 + BIOS is a good idea as a first step. I am well aware that this isn’t going anywhere – but now I’ve gained some experience and learned a ton of stuff, so maybe 32 bit or even 64 bit mode might be doable in the future? We’ll see.

It provides a syscall interface, can launch processes, read/write files (in a very simple filesystem).

Here’s a video where I run it natively on my old Dell Inspiron 6400 laptop (and Warp 3 later in the video, because why not):

https://movq.de/v/893daaa548/los86-p133-warp3.mp4

(Sorry for the skewed video. It’s a glossy display and super hard to film this.)

It starts with the laptop’s boot menu and then boots into the kernel and launches a shell as PID 1. From there, I can launch other processes (anything I enter is a new process, except for the exit at the end) and they return the shell afterwards.

And a screenshot running in QEMU:

Image

⤋ Read More
In-reply-to » Yeah, @eapl.me, I kinda like file extensions in some situations. What do you think of twtxt.exe, @bender? ]:->

haha, that’s gold xD.

#randomMemory I remember when I was starting to code, like 30 years ago, not understanding why my Basic file didn’t run when I renamed it to .exe

And nowadays, I’ve seen a few Go apps in a single executable, so twtxt.exe could be a thing, he!

⤋ Read More
In-reply-to » Finally, the message rendering in my tt Go rewrite produces some colors. There is definitely a lot more tweaking necessary. But this is a first step in the right direction.

Thank you @bender@twtxt.net and @movq@www.uninformativ.de!

I partially fixed the code block rendering. With some terrible hacks, though. :-( I see that empty lines in code block still need some more work. There are also some other cases around line continuation where the result looks ugly. I have to refactor some parts to make this go more smoothly and do this properly. No way around that.

Image

Turns out, my current message text parser does not even parse plain links. That’s next on the agenda.

Oh, I also noticed that this thing crashes when there is not enough space to actually draw stuff. No shortage of work. Anyway, time is up, good night. :-)

⤋ Read More

all of the software sucks, but i have a solution! we’ll write even more software! get more people involved, make it the Ideal Career, then we can write AL̵LĢ“ O̵F THĢØE ̧CĶ€ODEĢ·S. mountains of shitty garbage that kind-of does the thing. software will still suck, but T͜HEĢ•N oh then we can write compilers that let us run the old shitty code inside of our mountain of new shitty code. now all of the code is in a giant pile and we’re using it to control space ships that definitely never crash. the more code the better! we can represent NaN easily in undefined systems! developers aren’t particularly bright, so the language is simple and easy for them to understand. we know this, that’s why it was made this way. theĶ” mounĶ¢tain Ķ m̵us͜t Ķ nȩverĢ¢ Ģ“waĢ”veĢ“r̵. the more code the better. so instead of writing the code manually we cĢ“ómpileĢØ tĶžorĢøtĢ•u͜red soĢ·u͜ls ĶiĶžnĶžtoĶ ͟nice Ķ¢bĶ€lĢ·oxeĢ”ls ĢøofĶ  Ģøt̶anĢ”g͜lĶ€ed ĶžnĢ¢euĶraĢ”lĶ  Ģ•neĢ¢tĶw͟orkś.Ģø wĢØe dĶ on’t́ know how i̵t Ģ·w͟orkĢ”s, Ģ“but Ģ·tĢ“he modelĢ¢ ̶isĢ› 5Ģ›0GiB ́s̶o ͟iĶžt sĶže͘rve͟s Ģ“tḩeĢ› purpośe. WEĢ• MĶ USĢ“T BĶ¢UĢ¢ILD ĶTĶžHE MOĶUN̶TĢØA̵IN.

⤋ Read More
In-reply-to » Thanks @lyse! I'm replying here https://text.eapl.mx/reply-to-lyse-about-twtxt

Thank you, @eapl.me@eapl.me! No need to apologize in the introduction, all good. :-)

Section 3: I’m a bit on the fence regarding documenting the HTTP caching headers. It’s a very general HTTP thing, so there is nothing special about them for twtxt. No need for the Twtxt Specification to actually redo it. But on the other hand, a short hint could certainly help client developers and feed authors. Maybe it’s thanks to my distro’s Ngninx maintainer, but I did not configure anything for the Last-Modified and ETag headers to be included in the response, the web server just already did it automatically.

The more that I think about it while typing this reply, the more I think your recommendation suggestion is actually really great. It will definitely beneficial for client developers. In almost all client implementation cases I’d say one has to actually do something specifically in the code to send the If-Modified-Since and/or If-None-Match request headers. There is no magic that will do it automatically, as one has to combine data from the last response with the new request.

But I also came across feeds that serve zero response headers that make caching possible at all. So, an explicit recommendation enables feed authors to check their server setups. Yeah, let’s absolutely do this! :-)

Regarding section 4 about feed discovery: Yeah, non-HTTP transport protocols are an issue as they do not have User-Agent headers. How exactly do you envision the discovery_url to work, though? I wouldn’t limit the transports to HTTP(S) in the Twtxt Specification, though. It’s up to the client to decide which protocols it wants to support.

Since I currently rely on buckket’s twtxt client to fetch the feeds, I can only follow http(s):// (and file://) feeds. But in tt2 I will certainly add some gopher:// and gemini:// at some point in time.

Some time ago, @movq@www.uninformativ.de found out that some Gopher/Gemini users prefer to just get an e-mail from people following them: https://twtxt.net/twt/dikni6q So, it might not even be something to be solved as there is no problem in the first place.

Section 5 on protocol support: You’re right, announcing the different transports in the url metadata would certainly help. :-)

Section 7 on emojis: Your idea of TUI/CLI avatars is really intriguing I have to say. Maybe I will pick this up in tt2 some day. :-)

⤋ Read More
In-reply-to » Been curious to see if can filter out my access.log file and output a list of my twtxt followers just in case I've missed someone ... I came up with this awk -F '\"' '/twtxt/ {print $(NF-1)}' /var/log/user.log | grep -v 'twtxt\.net' | sort -u | awk '{print $(NF-1) $NF}' | awk '/^\(/' spaghetti monster of a command and I'm wondering if there's a more elegant way for achieving the same thing.

@prologic@twtxt.net yeah I’ve played with it for a bit and read through the code hoping I could steal some of your regex. I’m trying to up my awk(1p) game but failing miserably. šŸ˜†

⤋ Read More
In-reply-to » @doesnm Agree. salty.im should allow the user to post multiple brokers on their webfinger so the client can find a working path.

Honestly… not much. Have abandon two projects (both private) on Golang and one related to cryptography. My mostly languages are Python and Javascript (also can PHP). After writing code on Go i spend same time on fixing dumb errors

⤋ Read More
In-reply-to » (#eqgicaq) @3r1c I think I’m gonna like that blog. šŸ˜… https://unixdigest.com/articles/is-the-madness-ever-going-to-end.html

I am reminded of this when I look at entire forks of vscode just to add a LLM code completion assistant.

⤋ Read More
In-reply-to » @prologic I wanted to wait for things to settle down. It’s still unclear to me in which direction we’re going – and if that new/different stuff is even possible to implement in jenny. That said, I’ve been really busy with private stuff these last few days, I’ve lost track of most of what you’re discussing. 🄓

I share I did write up an algorithm for it at some point I think it is lost in a git comment someplace. I’ll put together a pseudo/go code this week.

Super simple:

Making a reply:

  1. If yarn has one use that. (Maybe do collision check?)
  2. Make hash of twt raw no truncation.
  3. Check local cache for shortest without collision
    • in SQL: select len(subject) where head_full_hash like subject || '%'

Threading:

  1. Get full hash of head twt
  2. Search for twts
    • in SQL: head_full_hash like subject || '%' and created_on > head_timestamp

The assumption being replies will be for the most recent head. If replying to an older one it will use a longer hash.

⤋ Read More

Sharing the comments of the poll (anonymous so I have no idea whom the comments are from):

your poll should include questions about markdown. personally i think inline bits like style, links, images are yes. block quotes, code blocks, bullet lists are mid. but tables and footnotes are no.

Yes sorry about this, I wasn’t able to change much after publishing the poll šŸ˜…

⤋ Read More
In-reply-to » I wrote some code to try out non-hash reply subjects formatted as (replyto ), while keeping the ability to use the existing hash style.

@david@collantes.us Well, I wouldn’t recommend using my code for your main jenny use anyway. If you want to try it out, set XDG_CONFIG_HOME and XDG_CACHE_HOME to some sandbox directories and only run my code there. If @movq@www.uninformativ.de is interested in any of this getting upstreamed, I’d be happy to try rebasing the changes, but otherwise it’s a proof of concept and fun exercise.

⤋ Read More
In-reply-to » I wrote some code to try out non-hash reply subjects formatted as (replyto ), while keeping the ability to use the existing hash style.

BTW this code doesn’t incorporate existing twts into jenny’s database. It’s best used starting from scratch. I’ve been testing it using a custom XDG_CACHE_HOME and XDG_CONFIG_HOME to avoid messing with my ā€œrealā€ jenny data.

⤋ Read More