1. Hugo Roy: Barnaby Walters Alex i'm curious how you get suggestions from ddg.gg (just testing the comments and indieauth)

    @hugoroyd I don’t actually get suggestions from DDG, the suggestions are from Google, but my search goes through DDG. Thinking about it, this probably actually negates many privacy benefits and I should turn it off.

  2. Yesterday we at Vísar tested the neat SVG image element hack on all the devices and browsers we had at hand to see how it performed and whether or not it was viable to use in production.

    Given this markup:

    <svg>
        <image xlink:href="http://example.com/the-image.svg" src="http://example.com/the-image.png" width="100" height="100" />
    </svg>

    Here’s a table of what each browser+device downloaded:

    Browser Format Requested
    Mob. Safari iOS 4.2.1 PNG
    Mob. Safari iOS 6.1.3 SVG
    Chrome 28 Mac SVG
    Safari 5.1.9 Mac SVG
    Safari 6.0.5 Mac SVG
    Firefox 26 Mac SVG
    Firefox 22 Mac SVG
    IE 8.0.6 PNG
    IE 10 SVG+PNG
    Kindle (3rd gen) PNG

    Note that the Kindle downloaded the PNG despite having pretty good SVG support. Tests carried out locally by watching the Django request logs.

    At first, this looked perfect — browsers which supported SVG only downloaded the SVG (apart from IE 10), and other browsers just got the PNG. However, it seems that SVG image elements can’t be sized with percentages, meaning our flexible layouts were never going to work. I tried to fix it using the dreaded viewBox and user units (as I have previously to compensate for percentage-based units not being allowed in SVG paths), but that just led to everything being completely the wrong size.

    So, (unless someone can show me how to fix this), whilst we think this is a great hack, it’s not going to work out for our product due to the weirdness of SVG sizing limitations.

  3. Ben Werdmuller: Government - the last great gatekeeper - is ripe for disruption.

    The first is to publicly declare the jurisdiction in which you live, and in which your data is hosted. That way, people can make an informed decision about how to communicate with you.

    That’s a really brilliant idea. Maybe link the brand names to their tosdr.org pages too.

  4. Every now and again I wonder if the same sort of fandoms which Adventure Time, My Little Pony et al have now would have arisen around things like The Clangers and Captain Scarlet if web culture had been as evolved (or even existed) in the 60-70s as it is now.

    Would people cosplay as Jones the Steam, post videos analysing the character development in The Herbs, communicate using Noggin The Nog reaction faces and write erotic Portland Bill fanfics?

    A bearded viking-esque guy in a pointed hat with safety covers drinks some ale, then spits it out in surprise and look to the right.

    Actually, don’t answer that.


    Spit-takes are better with ale and viking helmets. Wait, no. Everything is better with ale and viking helmets.

  5. I just faked having a task queue for note posting tasks using Symfony HttpKernel::terminate() and it was the easiest thing ever.

    Instances or subclasses of HttpKernel have a terminate($request, $response) method which, if called in the front controller after $response->send(); triggers a kernel.terminate event on the app’s event dispatcher. Listeners attached to this event carry out their work after the content has been sent to the client, making it the perfect place to put time-consuming things like POSSE and webmention sending.

    Once you’ve created your new content and it’s ready to be sent to the client, create a new closure which carries out all the the time consuming stuff and attach it as a listener to your event dispatcher, like this:

    $dispatcher->addListener('kernel.terminate', function() use ($note) {
        $note = sendPosse($note);
        sendWebmentions($note);
        $note->save();
    }
    

    Then, provided you’re calling $kernel->terminate($req, $res); in index.php, your callback will get executed after the response has been sent to the client.

    If you’re not using HttpKernel and HttpFoundation, the exact same behaviour can of course be carried out in pure PHP — just let the client know you’ve finished sending content and execute code after that. Check out these resources to learn more about how to do this:

    Further ideas: if the time consuming tasks alter the content which will be shown in any way, set a header or something to let the client side know that async stuff is happening. It could then re-fetch the content after a few seconds and update it.


    Sure, this isn’t as elegant as a message queue. But as I showed, it’s super easy and portable, requiring the addition of three or four lines of code.

  6. Ben Werdmuller: Indieweb video test

    @benwerd nice one! I’m currently working on video post-by-email. It almost worked here, next time should work flawlessly.

    The nice thing about using email to post videos is that it’s asyncronous — I can send the email and then go do something else, instead of having to either wait for it to upload or do the “if I switch apps now will it stop uploading argh what do I do” dance.