Tags: file

38

sparkline

Wednesday, August 8th, 2018

The SHE Is Series | SHE Is Ire Aderinokun

I started writing for myself. The writing was helpful for me and luckily it was helpful for other people as well. But even if you’re the only one that reads your blog it is still helpful as a way to learn.

Monday, August 6th, 2018

The Man Who Invented The Web - TIME

This seventeen year old profile of Tim Berners-Lee is fascinating to read from today’s perspective.

Tuesday, July 10th, 2018

When 7 KB Equals 7 MB - Cloud Four

I remember Jason telling me about this weird service worker caching behaviour a little while back. This piece is a great bit of sleuthing in tracking down the root causes of this strange issue, followed up with a sensible solution.

Sunday, June 17th, 2018

Detecting image requests in service workers

In Going Offline, I dive into the many different ways you can use a service worker to handle requests. You can filter by the URL, for example; treating requests for pages under /blog or /articles differently from other requests. Or you can filter by file type. That way, you can treat requests for, say, images very differently to requests for HTML pages.

One of the ways to check what kind of request you’re dealing with is to see what’s in the accept header. Here’s how I show the test for HTML pages:

if (request.headers.get('Accept').includes('text/html')) {
    // Handle your page requests here.
}

So, logically enough, I show the same technique for detecting image requests:

if (request.headers.get('Accept').includes('image')) {
    // Handle your image requests here.
}

That should catch any files that have image in the request’s accept header, like image/png or image/jpeg or image/svg+xml and so on.

But there’s a problem. Both Safari and Firefox now use a much broader accept header: */*

My if statement evaluates to false in those browsers. Sebastian Eberlein wrote about his workaround for this issue, which involves looking at file extensions instead:

if (request.url.match(/\.(jpe?g|png|gif|svg)$/)) {
    // Handle your image requests here.
}

So consider this post a patch for chapter five of Going Offline (page 68 specifically). Wherever you see:

if (request.headers.get('Accept').includes('image'))

Swap it out for:

if (request.url.match(/\.(jpe?g|png|gif|svg)$/))

And feel to add any other image file extensions (like webp) in there too.

Thursday, May 17th, 2018

New Privacy Rules Could Make This Woman One of Tech’s Most Important Regulators - The New York Times

It’s kind of surreal to see a profile in the New York Times of my sister-in-law. Then again, she is Ireland’s data protection commissioner, and what with Facebook, Twitter, and Google all being based in Ireland, and with GDPR looming, her work is more important than ever.

By the way, this article has 26 tracking scripts. I don’t recall providing consent for any of them.

Monday, April 23rd, 2018

The Woman Who Gave the Macintosh a Smile | The New Yorker

A profile of Susan Kare, icon designer extraordinaire.

I loved the puzzle-like nature of working in sixteen-by-sixteen and thirty-two-by-thirty-two pixel icon grids, and the marriage of craft and metaphor.

Friday, February 9th, 2018

Href Tools - Free online web tools

Handy web-based tools—compress HTML, CSS, and JavaScript, and convert files from one format to another.

Tuesday, January 16th, 2018

How To Make A Drag-and-Drop File Uploader With Vanilla JavaScript — Smashing Magazine

A step-by-step guide to implementing drag’n’drop, and image previews with the Filereader API. No libraries or frameworks were harmed in the making of this article.

Wednesday, November 8th, 2017

Inside Design: Clearleft

A profile of Clearleft from the nice people at InVision.

Although there is this:

Monday, September 11th, 2017

No space left on device – running out of Inodes – Ivan Kuznetsov

This blog post saved my ass—the Huffduffer server was b0rked and after much Duck-Duck-Going I found the answer here.

I’m filing this away for my future self because, as per Murphy’s Law, I’m pretty sure I’ll be needing this again at some point

Wednesday, March 22nd, 2017

WTF, forms?

Here’s a CSS file that will give you a bit more control over styling some form elements. The thinking behind the CSS for each element is explained nice and clearly.

Thursday, January 12th, 2017

Saving you bandwidth on Google+ through machine learning

This is an interesting use of voodoo magic (or “machine learning” as we call it now) by Google to interpolate data in a small image to create a larger version. A win for performance.

Thursday, March 24th, 2016

Angola’s Wikipedia Pirates Are Exposing the Problems With Digital Colonialism | Motherboard

The street finds its own uses for colonial internet practices:

Because the data is completely free, Angolans are hiding large files in Wikipedia articles on the Portuguese Wikipedia site (Angola is a former Portuguese colony)—sometimes concealing movies in JPEG or PDF files. They’re then using a Facebook group to direct people to those files, creating a robust, completely free file sharing network.

Saturday, December 19th, 2015

Photo upload and progressive enhancement for FixMyStreet / mySociety

Matthew describes a very nice bit of progressive enhancement for drag’n’drop file uploads (similar to the CSS Tricks article I linked to recently).

It uses the Dropzone JS which looks like it aligns nicely with the progressive enhancement approach.

Tuesday, December 1st, 2015

Drag and Drop File Uploading | CSS-Tricks

This is a terrific example of progressive enhancement in action: going from a simple file input to a lovely interactive drag’n’drop interface.

The code uses jQuery but it could be easily adapted to vanilla JavaScript, and anyway, it’s not so much the code that matters, it’s the approach.

Thursday, April 23rd, 2015

Thursday, April 9th, 2015

100 words 018

Steven Johnson has oft waxed lyrical on the benefits of keeping a spark file—the modern equivalent of a nineteenth century commonplace book.

I started keeping a spark file. But I was keeping it the late lamented Editorially so my experiment was cut short. This is far as I got…

The transatlantic telegraph cable :: the space elevator.

The web :: the patent that never was.

The Mechanical Turk as design fiction, influencing Babbage.

These are the ramblings of a madman. But I might be able to use some of this—I need to prepare a new talk for later this year.

Wednesday, April 8th, 2015

CloudConvert - convert anything to anything

Ignore the silly name: this looks a supremely useful service—convert just about any file format into just about any other file format.

Friday, January 23rd, 2015

The Emularity « ASCII by Jason Scott

Jason documents some pretty amazing levels of emulation in JavaScript:

That’s Netscape 1.0n, released in December of 1994, running inside Windows 3.11, released in August of 1993, running inside of Google Chrome 39.0.2171.99 m, released about a week ago, on a Windows 7 PC, released in 2009.

But when it comes to trying to navigate the web with that set-up, things get a bit depressing.

Tuesday, December 2nd, 2014

On File Formats, Very Briefly, by Paul Ford · The Manual

A history lesson and a love letter to the early web, taking in HTML, Photoshop, and the web standards movement.

Those were long years, the years of drop-shadows. Everything was jumping just slightly off the screen. For a stretch it seemed that drop-shadows and thin vertical columns of text would define the web. That was before we learned that the web is really a medium to display slideshows, as many slideshows as possible, with banner ads.