Searching yarn

Twts matching #test
Sort by: Newest, Oldest, Most Relevant
In-reply-to » Can anyone recommend a command-line SQL query formatter? Unfortunately, sqlparse is also unsuitable for me: https://github.com/andialbrecht/sqlparse/issues/688

I’m supporting incremental SQLite schema changes to just upgrade from an older database version to whatever the current software version supports. In the past, I already noticed that this is quite expensive in unit tests when each test case runs through the entire schema patches and applies them one by one.

To speed up test execution I now decided that I finally go through the troubles of maintaining both a set of incremental patches and a full schema setup in one go. A unit test verifies that both ways end up with the same structure. This gives me a set of SQLs to check the structures:

SELECT type, name, tbl_name, sql
FROM sqlite_schema
ORDER BY type, name, tbl_name

Unfortunately, the resulting CREATE TABLE SQL queries are formatted differently, depending on whether the full schema was set up in one big step or the structure had been modified with ALTER TABLE. Mainly, added columns are not on their own lines but appended in one physical line. That’s why I wanted an SQL formatting tool. Since I didn’t find one that works decently, I’m now doing some simple string manipulation. Joining consecutive whitespace into a single space character, removing spaces before commas and closing parentheses and spaces after opening parentheses. This works surpringly good enough. Of course, if it fails, the “diff” is absolutely horrendous.

Now for the cool part, my test execution dropped from around 5:05 minutes to just 1:32 minutes! I call that a win.

I just stumbled across PRAGMA table_info('tablename') https://sqlite.org/pragma.html#pragma_table_info, PRAGMA foreign_key_list('tablename') and friends. I guess, I have to play with that, now. It’s probably much better to use than the SQL text approach.

⤋ Read More
In-reply-to » Behold! 🥳 My first (hopefully it doesn't fail 🤞) µSaaS (microSaaS)

@bender@twtxt.net Thanks for letting me know it was Mobile Safari! I just did some testing real quick and things are not working very well 🤔 I think I’ve introduced some regressions last night as I was putting this into prod 😅 services me right for late-night deployment 🤣 I’ve taken it down for now, will spend a bit more time on testing making sure things all work properly!

⤋ Read More

Spent most of the long weekend working on a few coding projects… specifically, I pushed some updates for TwtKpr to my test instance before spending some time working on the build process and demo page for my new twtxt-parsing library… which lead me to make some changes to my existing fluent-dom-esm library.

So, nothing actually got finished, but the incremental updates continue…

⤋ Read More
In-reply-to » More widget system progress:

And now the event loop is not a simple loop around curses’ getch() anymore but it can wait for events on any file descriptor. Here’s a simple test program that waits for connections on a TCP socket, accepts it, reads a line, sends back a line:

https://movq.de/v/93fa46a030/vid-1767547942.mp4

And the scrollbar indicators are working now.

I’ll probably implement timer callbacks using timerfd (even though that’s Linux-only). 🤔

⤋ Read More
In-reply-to » Nice! 😊 Here are the startup latencies for the simplest Mu (µ) program. println("Hello World"):

@lyse@lyse.isobeef.org A “Hello World” binary is ~372KB in size. I currently have peephole optimization and deac code optimizations in play, and a few other performance related ones, but nothing too fancy. I have a test case that ensures fib(35) doesn’t regress too badly as I continue to evolve the language.

⤋ Read More

mu (µ) now has builtin code formatting and linting tools, making µ far more useful and useable as a general purpose programming language. Mu now includes:

  • An interpreter for quick “scriptinog”
  • A native code compiler for building native executables (Darwin / macOS only for now)
  • A builtin set of developer tools, currently: fmt (-fmt), check (-check) and test (-test).

⤋ Read More
In-reply-to » @lyse Well, I used SnipMate years ago (until 2012). IIRC, it’s more than just “insert a bit of text here”, it can also jump to the correct next location(s) and stuff like that. Don’t remember why I stopped using it.

@movq@www.uninformativ.de Thanks! I’ll have a look at SnipMate. Currently, I’m (mis)using the abbreviation mechanism to expand a code snippet inplace, e.g.

autocmd FileType go inoreab <buffer> testfunc func Test(t *testing.T) {<CR>}<ESC>k0wwi

or this monstrosity:

autocmd FileType go inoreab <buffer> tabletest for _, tt := range []struct {<CR>    name string<CR><CR><BS>}{<CR>   {<CR>   name: "",<CR><BS>},<CR><BS>} {<CR>  t.Run(tt.name, func(t *testing.T) {<CR><CR>})<CR><BS>}<ESC>9ki<TAB>

But this of course has the disadvantage that I still have to remove the last space or tab to trigger the expansion by hand again. It’s a bit annoying, but better than typing it out by hand.

⤋ Read More

Oh great, I received an e-mail that my SMTP credentials have been exposed. Once again, just another shitty scanner that generates garbage reports from tests it doesn’t understand. Thank you for nothing!

conf := &Config{
    SMTPHost: "smtp.example.com",
    SMTPPort: 587,
    SMTPUser: "user",
    SMTPPass: "hunter2",
    SMTPFrom: "from@example.com",
}

⤋ Read More

Hi everyone 👋

I’ve been experimenting with different creative tools recently, mostly around image and video editing, and I came across an interesting AI-based face editing website:
https://remakeface.ai/

What I found useful is that it focuses on realistic face replacement and quick previews, which can be handy for creative projects, short videos, or just experimenting with ideas before doing more detailed work elsewhere.

I’m curious if anyone here has tried similar tools or has recommendations for AI-assisted image or face editing that feels natural rather than overly artificial. Always interested in learning what others in the community are using or testing lately.

Looking forward to your thoughts 🙂

⤋ Read More

I cleaned up all my of AoC (Advent of Code) 2025 solutions, refactored many of the utilities I had to write as reusable libraries, re-tested Day 1 (but nothing else). here it is if you’re curious! This is written in mu, my own language I built as a self-hosted minimal compiler/vm with very few types and builtins.

https://git.mills.io/prologic/aoc2025

⤋ Read More
In-reply-to » @aelaraji Ahhh! That would be even funnier and even more brilliant! 🤣 If you can find this, I would happily employ this tactic next time and make 'em pay 💰 Bahahahaha 🤣

@aelaraji@aelaraji.com I like the sounds of this technique a lot redirecting these AI crawling assholes to multi gigabyte files! The only concern I have is how do you do it in such a way that you don’t end up destroying your own ISP speed test servers?

⤋ Read More
In-reply-to » Advent of Code 2025 starts tomorrow. 🥳🎄

Day 2 was pretty tough on my old hardware. Part 1 originally took 16 minutes, then I got it down to 9 seconds – only to realize later that my solution abused some properties of my particular input. A correct solution will probably take about 30 seconds. 🫤

Part 2 took 29 minutes this morning. I wrote an optimized version but haven’t tested it yet. I hope it’ll be under a minute.

Python 1 feels really slow, even compared to Java 1. And these first puzzles weren’t even computationally intensive. We’ll see how far I’ll make it …

https://movq.de/v/f831d98103/day02.jpg

⤋ Read More
In-reply-to » Which actively maintained Yarn/twtxt clients are there at the moment? Client authors raise your hands! 🙋

@lyse@lyse.isobeef.org Damn. That was stupid of me. I should have posted examples using 2026-03-01 as cutoff date. 😂

In my actual test suite, everything uses 2027-01-01 and then I have this, hoping that that’s good enough. 🥴

def test_rollover():
    d = jenny.HASHV2_CUTOFF_DATE
    assert len(jenny.make_twt_hash(URL, d - timedelta(days=7), TEXT)) == 7
    assert len(jenny.make_twt_hash(URL, d - timedelta(seconds=3), TEXT)) == 7
    assert len(jenny.make_twt_hash(URL, d - timedelta(seconds=2), TEXT)) == 7
    assert len(jenny.make_twt_hash(URL, d - timedelta(seconds=1), TEXT)) == 7
    assert len(jenny.make_twt_hash(URL, d, TEXT)) == 12
    assert len(jenny.make_twt_hash(URL, d + timedelta(seconds=1), TEXT)) == 12
    assert len(jenny.make_twt_hash(URL, d + timedelta(seconds=2), TEXT)) == 12
    assert len(jenny.make_twt_hash(URL, d + timedelta(seconds=3), TEXT)) == 12
    assert len(jenny.make_twt_hash(URL, d + timedelta(days=7), TEXT)) == 12

(In other words, I don’t care as long as it’s before 2027-01-01. 😏😅)

⤋ Read More
In-reply-to » Tired to re-enable the Ege route to git.mills.io today (after finishing work) and this is what I found 🤯 Tehse asshole/cunts are still at it !!! 🤬 -- So let's instead see if this works:

@prologic@twtxt.net I remember reading a blog-post where someone has been throwing redirects to some +100GB files (usually used for speed testing purposes) at a swarm of bots that has been abusing his server in order to criple them, but I can’t find it anymore. I’m pretty sure I’ve had it bookmarked somewhere.

⤋ Read More

All my newly added test cases failed, that movq thankfully provided in https://git.mills.io/yarnsocial/twtxt.dev/pulls/28#issuecomment-20801 for the draft of the twt hash v2 extension. The first error was easy to see in the diff. The hashes were way too long. You’ve already guessed it, I had cut the hash from the twelfth character towards the end instead of taking the first twelve characters: hash[12:] instead of hash[:12].

After fixing this rookie mistake, the tests still all failed. Hmmm. Did I still cut the wrong twelve characters? :-? I even checked the Go reference implementation in the document itself. But it read basically the same as mine. Strange, what the heck is going on here?

Turns out that my vim replacements to transform the Python code into Go code butchered all the URLs. ;-) The order of operations matters. I first replaced the equals with colons for the subtest struct fields and then wanted to transform the RFC 3339 timestamp strings to time.Date(…) calls. So, I replaced the colons in the time with commas and spaces. Hence, my URLs then also all read https, //example.com/twtxt.txt.

But that was it. All test green. \o/

⤋ Read More
In-reply-to » Anyone run a Mastodon serve rI can have an account on to help test the Twtxt <-> Activity Pub bridge? 🙏

@prologic@twtxt.net no, I really meant small. I only have a handful of GiBs left of storage. If you can wait until mid-December, then no probleml. Right now it is kind of running on fumes. For testing, and to do not disturb anyone timelines, I recommend you run a small test instance. Running GtS is easier than running Yarn, by the way. Word.

⤋ Read More

For those curious, the new Twtxt <-> ActivityPub bridge I’m building (bidirectional) simply requires three things:

  1. You register your Twtxt feed to the bridge: https://bridge.twtxt.net
  2. You verify that you in fact own/control the feed by putting the verification code somewhere on/in your feed (doesn’t matter where or how)
  3. You proxy/forward requests for /.well-known/webfinger to the Bridge bridge.twtxt.net.

I’m still testing through and ironing out bugs 🐛 Please be patient! 🙏

⤋ Read More

Thank you for the encouragement and love and kind words, @lyse@lyse.isobeef.org @movq@www.uninformativ.de @bender@twtxt.net @doesnm@doesnm.p.psf.lt and others along the way I’m not sure of their feed uris 💕 I’ll keep at it, but for the time being I will keep my distance, mostly off IRC, because I don’t have the energy to spare in that kind of engagement (what//if the worst happens, it’s so draining). I need to remember what I ever did any of this for, it was back in ~2020 and I wanted really to build small interconnected communities that any non “tech savvy” person (more or less) could also benefit from ane enjoy. Even if there are aspects of the specs we’ve built/extended over time that aren’t “perfect”™, they’re “good enough”™ that they’ve last 5+ years (I believe this is 6 years running now). I want to spend a bit of time going back to why I did any of this in the the first place, and get a little micro-SaaS offering going (barely covering running costs) so encourage more folks to run pods, and thus twtxt feeds and grow the community ever so slightly. Other than that, I plan to get the specs “in order” to a point (with @movq@www.uninformativ.de and @lyse@lyse.isobeef.org’s help) where I hope they’ll stand the test of time – like SMTP.

Thank you all ! 🙏

⤋ Read More
In-reply-to » Wow! 🤩 Are folks actually using Gatherly already? 🤔 Media

I had a looksie (just to be sure) at the database, and they were thankfully legit test events. But this did spark/trigger me to make sure I have some form of anti-spam measures in place. So I added some per-event / per-rsvp rate-limiting and honeypot(s).

⤋ Read More
In-reply-to » Hi everyone, here's a little introduction of my twtxt client (still WIP).

@zvava@twtxt.net CORS is our worst enemy. 🥷

I too had the same issue being a browser-based request, so the only solution is using a proxy.

For testing (and real personal use) I rely on this one https://corsproxy.io/.

In my client, I first check if the source allows me to fetch it without issues first and fallback to prefixing with a proxy if it gives an error.

For security reasons the client don’t give you a readable error for CORS, so you must use a catch-all for that, if it fails again with the proxy you can deal with any other errors it throws as you normally would (preferably outside of the fetch function).

After the fetching responded, I store the response.url value to fetch it again for updates without having to do extra calls (you can store it verbatim or as a flag to be able to change the proxy later).

Here an extract of my code:

export async function fetchWithProxy(url, proxy=null) {
    return await fetch(url).catch(err => {
        if (!proxy) throw err;
        return fetch(`${proxy}${encodeURIComponent(url)}`);
    });
}

// Using it with
const res = await fetchWithProxy('https://twtxt.net/user/zvava/twtxt.txt', 'https://corsproxy.io/?');

// Get the working url (direct or through proxy)
const fetchingURL = res.url;

// Get the twtxt feed content (or handle errors)
const text = await res.text();

I also plan to allow the user to define a custom proxy field, I like the solution used by Delta.chat in their android app, where you can define the URL format with a variable https://my-proxy?$TWTXT_URL since it allows you to define with more freedom any proxy without a prefix format.

If the idea of using a third-party proxy is not to the user liking they can use a self-hosted solution like cors-anywhere or build their own (with twtxt it should just be a GET).

⤋ Read More
In-reply-to » @movq I'm glad it make sense for you 😅 I will never understand it. All I know is that I'm a conservative socialist and there's a lot of "stupid shit"™ happening in the world (including my own country). I still blame extreme Capitalism.

@bender@twtxt.net Well see that’s just what the freak’n tests say about me haha 🤣

immigration and multiculturalism

What about it? I grew up in a multicultural country.

⤋ Read More
In-reply-to » @bender Really? 🤔

And I need to make something absolutely clear as well here. Twtxt was completely and utterly dead back in {Aug 2020](https://yarn.social/about.html) when I came across the spec and its simplicity and realised the lost opportunity. Since then we’ve continued to grow a small but thriving community. The extensions we’ve built over time have stood and lasted the test of time for the past ~5 years. We need not break things too badly, because what we have today and was designed years ago actually works quite well™ (despite some flaws).

⤋ Read More