Author: viktor

  • combine all supabase migrations into one

    Some terms make total sense when this is what you are starting thinking from, and you can’t get to them when you started somewhere else. Seems it is not only my problem but LLMs too. Supabase have AI assistant that you can ask something.

    I needed to combine all the migrations into one and was wondering if there is existing tooling available, so I asked Assistant and it gave me two pages of the options how to do it. And it mostly works but it is not really that savvy with supabase CLI.

    At the same time supabase CLI has a tool for doing it, and it is named perfectly well

    supabase migrations squash

    It does exactly what I need, merges or squashes all migrations into latest one, and update local history. It also gives you command to update remote history:

    supabase migrations repair --status applied

    So there is tooling already and it is named well but AI didn’t help until I sit down and explored the docs for CLI.

  • TIL

    I somehow completely missed that Apple added https://github.com/apple/container, so no need for docker or orbstack on a mac.

  • P3 color space and gradient render bug in safari.

    While exploring difference in addressable colors in sRGB vs p3 I noticed weird behavior when using gradient with LSH color palette.

    If you are using gradient with lsh, colors are properly stretched for the linear gradient, eg

    background:
          linear-gradient(
            in lch to right,
            lch(var(--L) var(--C) 0deg),
            lch(var(--L) var(--C) 60deg),
            lch(var(--L) var(--C) 120deg),
            lch(var(--L) var(--C) 180deg),
            lch(var(--L) var(--C) 240deg),
            lch(var(--L) var(--C) 300deg),
            lch(var(--L) var(--C) 360deg)
          );

    This is middle piece of the image above. If you are using oklsh with new color space,

    background:
          linear-gradient(
            in oklch to right,
            oklch(var(--L) var(--C) 0deg),
            oklch(var(--L) var(--C) 60deg),
            oklch(var(--L) var(--C) 120deg),
            oklch(var(--L) var(--C) 180deg),
            oklch(var(--L) var(--C) 240deg),
            oklch(var(--L) var(--C) 300deg),
            oklch(var(--L) var(--C) 360deg)
          );

    You get colors cut off in safari, see bottom part of the screenshot.

    You can see the code to produce this image here

  • Things from internet

    I like articles like this, make you pause and ruminate and take another look at mundane things. Some items are funny some are very intimately felt. Reminded me in the middle of the Louise C.K. phrase from one interview a decade ago: “You are sitting in the chair in the sky!” (Ah here it is.) Thanksgiving time is an obvious time to reflect on what you are grateful for. My friend texted me and we exchange few words on a random meeting almost 15 years ago that led to this friendship. It was not something profound, just what “kids these days” :joy: call “we matched energy”. We live in amazing times, hot water running, cell phone in your palm has more power than whole NASA program that landed us on a moon, we have amazing medicine, at the same time tons of systemic issues make us blind to what we have.

    Fun discussion around APL and J and code readability – 1 and 2 and 3 APL always fascinated me, same with MUMPS. When I was in school my peers liked to argue on C vs Pascal syntax and how C is more readable, but compared to APL and MUMPS, these are all the same and there are these completely alien languages. There is fun book 7 languages in 7 weeks that take you through some less common languages, and i think it is useful exercise to do. Trying at least one functional programming language is a must, although today if you are touching front end , high likelihood you will do something in react, that to me is a decent functional programming gateway drug. Same as jQuery was before that, although not every codebase. But going back to J and friends, those are important if you want to get more than your feet wet with code golf, and also being an array language it forces you to really think differently.

    Some one made gemini halucinate what HN front page will look like 10 years from now – https://dosaygo-studio.github.io/hn-front-page-2035/news and wow this is brilliant.

    “Ask HN: How do you prevent ad-injection in AR glasses?” hit too close home.

  • Things from internet

    I love reading on the internals of frontier AI models, and this is one of the best reads on that: Opus Soul Document. I keep thinking that we need to intentionally think how human babies absorb knowledge and approach teaching models in the similar manner , only codifying tacit knowledge for llm consumption. I am also super curious if Yann LeCunn is right and LLM is a dead end and we will need a different approach altogether. However even if he is right, there is much to improve in the current state of llm-based AI.


    Washington Post article(or archive link) about Oscar Wilde’s Portrait of Dorian Gray is a nice read, and now I want to re-read it and see the play!


    37Signals always had special place in my heart, maybe it is Rails to blame, maybe it is their books, but never the less. Two pieces that I came across today were Radiating Programmer and Modern CSS, which was mentioned here. I remember fun and sorrows of updating websites over FTP with Cyberduck and it warms my heart that we are removing some levels of complexity that were built in past two decades. Is it google to blame for starting it with Closure compiler?

    After ruminating on Radiating Programmer and looking back at my career I find that my lack of practice of writing is the single factor that limited me the most.

    And with all the modern CSS, this was my favorite part:

    @media (any-hover: hover) and (pointer: fine) {
      /* Reveal the button only on hover */
    }
    
    @media (any-hover: none) and (pointer: coarse) {
      /* Show the button all the time */
    }
    

    This is especially magical with a device like the iPad Pro. Which can match both queries under certain conditions, and change on-the-fly. When it’s docked on the Magic Keyboard with built-in trackpad, it matches the first query and the ••• buttons are hidden until you hover. Lift it off the Magic Keyboard and it becomes a purely touch device—the ••• buttons magically appear. It’s very cool.


    I like buying old books. Used book stores is one of the best places in general, and if it is connected with coffee shop, every time I feel I can just live there. Very often though, I would buy a book because I liked the title, and forget about it, especially know, when I have great big bookshelves that I can keep filling in for quite some time. I found book I bought last year that I was really eager to read and completely forgot about it’s existence – A PARODY OUTLINE OF HISTORY by Donald Ogden Stewart. Book was in a bad shape, so i was happy to see it is published on Gutenberg, so i can read it on my iPad, but also I did not connect 2 and 2 that this is same guy who wrote Philadelphia Story. Book itself turned out to be a satire (doh!) of HG Wells’ The Outline of History, and Wells is the very first sci-fi writer I ever read. I think I was 5 and The Magic Shop completely blew my mind. I read most of the other short stories from his book I had after. I could not finish the The War of the Worlds, and switched to some fantasy book instead, can’t remember what it was though.


  • Things from internet

    I vaguely remembered French government was doing something like that, but never look closer, today I came across catala, and I love this so much:

    scope QualifiedEmployeeDiscount :
      definition qualified_employee_discount
        under condition is_property consequence
      equals
        if employee_discount >=
          customer_price * gross_profit_percentage
        then customer_price * gross_profit_percentage
        else employee_discount
    

    Makes me remember being 20-something and wishing everything was code.


    Wonderful, more than a century old book Monograms & Ciphers (by Albert Angus Turbayne) has some cool examples of monograms (doh):

    As I was searching for monograms I came across few websites selling monograms to you and several of them has just ideas from this book and J.O Kane’s Decorative monograms.


    There is vast library of field manuals from various government agencies. US Antarctic program is fascinating. I have strong feeling that if you want to start doing something new, checking for some field manual can save a lot of time building expertise.

    And tangental related to this, I like tech books with “war stories” eg Release It ( you can read it for free with San Francisco public library account, that has access to oreilly.com)

  • World digital infrastructure

    I keep seeing this image and it is so true!

  • some stuff i read today

    Human Invariant – Don’t Build an Audience – as some of my friends try to double with publishing videos and shorts across all the social media, I keep thinking about it. Is algorithms really smart enough or it is an illusion. Seems to me if you have enough content and push it a bit with promoting it is mostly true.

    https://archive.org/details/vanishingactssci0000unse/page/378/mode/2up – wonderful book, a collection of science fiction. I found it because of Ted Chiang story Seventy Two letters, but what really got me was this marvel:

    ENDANGERED SPECIES by JOE HALDEMAN

    Men stop war to make gods
    sometimes. Peace gods, who would make
    Earth a haven. A place for men to
    think and love and play. No war
    to cloud their minds and hearts. Stop,
    somehow, men from being men.

    Gods make war to stop men
    from becoming gods.
    Without the beat of drums to stop
    our ears, what heaven we could make
    of Earth! The anchor that is war
    left behind? Somehow free to
    stop war? Gods make men to
    be somewhat like them. So men
    express their godliness in war.
    To take life: this is what gods
    do. Not the womanly urge to make
    life. Nor the simple sense to stop.

    War-men make gods. To stop
    those gods from raging, we have to
    find the heart and head to make
    new gods, who don’t take men
    in human sacrifice. New gods,
    who find disgust in war.

    Gods stop, to make men war
    for their amusement. We can stop
    their fun. We can make new gods
    in human guise. No need to
    call to heaven. Just take plain men
    and show to them the heaven they could make!

    To stop God’s wars! Men make
    their own destiny. We don’t need war
    to prove to anyone that we are men.
    But even that is not enough. To stop
    war, we have to become more. To
    stop war, we have to become gods.

    To stop war, make men gods.

    Avoid the Spot lite by Sean Goedecke – I continue to collect the articles on craft and influence in the engineering organizations, if you are interested in growing in big tech, this is a good blog to follow.