Loading webcomponents-lite with require()

I just realised that the Web Components polyfills not only are in npm so you can install them like this:

npm install --save webcomponents-lite

but they also have a well formed package.json with a main entry.

So if you’re writing your front-end code with Browserify and want to load the polyfill without adding an additional script tag, you can do this:

require('webcomponents-lite');

and this pulls the polyfill into the scope.

NICE! Thanks, Addy :-)

PS I guess this should also work with webpack, if you’re so inclined.

Reading list, 5

13-19th April 2015

  • tableflip dot club by (╯°□°)╯︵ ┻━┻: “We’ve watched mediocre men whiz by us on a glass escalator […] we’re denied opportunities because we aren’t “ready” for them […] It’s time we take our potential elsewhere […] We’re sharing our long memories of all the creeps who’ve hit on us and the cowards who’ve failed to promote us”. Oh wow. This resonates so much with some of my experiences, wow. Yes. More tableflips are in order!
  • Of undocumented Chrome features and unreadable W3C specs by ppk: “this sad state of affairs prevents me from writing tests and reporting their outcome on all these new, exciting technologies”, or why new undocumented APIs without examples are a tragic failure
  • The newly created Web Audio London meetup has published videos with the talks from the first meetup! they are in its YouTube channel
  • There is also a Music Hackspace in London! I haven’t been so I can’t tell how good is it.
  • More music: my pal Andy Lemon made a series of Commodore 64-based covers of 80s tunes
  • Gifsicle – command line animated GIFs. We can always add new tools for our Animated GIF battles. Its website is pretty terse but the GitHub page is more detailed: “it can merge several GIFs into a GIF animation; explode an animation into its component frames; change individual frames in an animation; turn interlacing on and off; add transparency; add delays, disposals, and looping to animations; add and remove comments; flip and rotate; optimize animations for space; change images’ colormaps; and other things”… *swooooooooning*
  • More control over text-decoration by Chris Coyier at CSS-Tricks — where the text-decoration CSS property can be further controlled with three new sub-properties: text-decoration-color, text-decoration-line and text-decoration-style. This is fantastic! I’m going to start using text-decoration-style: wavy everywhere! ;-)
  • More CSS! Gradients are sometimes hard to visualise, so Patrick Brosset wrote a tool which would do exactly that. This week, he moved it from codepen to a GitHub repository. Look at it–can you make it better?
  • Despoblados en Huesca – a website that collects all the abandoned towns and smaller settlements in Huesca, an Spanish province. I’m fascinated both by this and by the idea that some people do take over some of these settlements and make them inhabitable again. This notion of self-sufficiency has always intrigued me.
  • DiscoGS – I acquired a Sinology home NAS last week and I have been carefully rearranging and sorting my music collection. This website is a fantastic resource when you really start getting perfectionist and detailed about PROPERLY TAGGING the files.

Solving the “multiple MacVim instances” confusion

I somehow started to experience this confusing situation where I would have two instances of MacVim open, so I was able to Command-Tab between them, and it was really annoying because if I wanted to switch between different windows of MacVim I had to locate which of the instances contained the window I wanted to edit files on. See where am I getting? No? I understand, it was very confusing.

However I found what had happened: I had two versions of MacVim installed.

So when I opened something with the command line mvim shortcut, one of the instances would be executed. And when I opened some file with “open with MacVim” the other instance would be executed. Chaos ensued!

The solution was to delete the MacVim.app in the /Applications folder, and uninstall it from Homebrew:

brew uninstall macvim

and install it again:

brew install macvim

Now I’m back to just one MacVim instance. Yay!

Running a web server on the front-end

The introduction of TCP sockets support in Firefox OS made it possible to run a web server from the front-end, and all is written in JavaScript. Think of having something similar to express.js… but running on a browser (because after all, Firefox OS is a superturbocharged browser).

Again, JS server superstar Justin d’Archangelo wrote an implementation of a web server that works on Firefox OS. It’s called fxos-web-server and it includes a few examples you can run.

None of the examples particularly fit my use case–I want to serve static content from a phone to other phones, but the examples were a bit more contrived. So I decided to build a simpler proof-of-concept example: catserver, a web server that served a simple page with full screen Animated GIFs of cats:

Continue reading

Reading list, 4

~~~~shameless plug~shameless plug~shameless plug~shameless plug~shameless plug~~~~

Cover of Butterflies EP First of all — a SHAMELESS PLUG! I released my Butterflies EP last week and if you’re into electronic music you might want to check it out! There’s also a Too Long; Didn’t Listen (TL;DL) 1:30 version in SoundCloud, just in case you’re too busy for a full album :-D

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Now for the non-shameless-pluggy list of links!

6th-12th April

  • Atomic Design by Brad Frost – This is a book on progress on an intriguing solution to a most relevant problem: designing for the immense variety of devices we use to access the net. I haven’t had much time to look into it, but it won me with just the first chapter’s tagline: “Create design systems, not pages”. I’m looking forward to Brad’s talk in UpFrontConf Manchester!
  • And also from Brad: Accessibility and low powered devices, and as he describes it: “an interesting intersection between performance, accessibility, and devices”.
  • Mozilla’s Web API Exposure guidelines – Mozilla is not using prefixes on new APIs anymore and opting for browser flags instead. This not news, but more of a reminder.
  • It’s OK for your open source library to be a bit shitty by David R. MacIver — “It’s not a job after all, is it? We’re not paying you to do it.” – except for when it seems to be, and it’s so damn exhausting sometimes. But as David says: “If the world comes back to you and says “You are a bad person for not supporting this thing I need you to support” then fuck them. If they want that they should pay you for it, or do it themselves.”
  • Surprise! Feminism – a follow up by David R. MacIver too! Or: why you will see way less women in Open Source, as it takes free time and money, two things we on average have less of.
  • What Your Open Source Culture Really Says, Part One by Shanley Kane – there are so many thought provoking points in the article, but “The only thing holding this project remotely together is romanticized notions of free and open source software” is a good one to start challenging yourself with. Can projects survive on a romantic idea? (answer: most definitely not)
  • The Spanish entity in charge of issuing SSL certificates for most of the country’s administrative and governmental servers uses certificates that trigger “this certificate is invalid” warnings in browsers. Thanks to bureaucracy, the bug is dragging for 7 years already. Fascinating and sad read, including typos in manually copied hashes, processes getting stuck for months because people go on holidays, and technical misconfigurations.
  • Making Music. Creative strategies for Electronic music producers by Dennis DeSantis who apparently wrote the Ableton live manual? – I have never been able to figure out how Ableton works; there’s something in its UI that doesn’t quite click with my brain, but the book looks interesting (and also beautiful). There are some chapters online!
  • And finally, a FUN ONE: Golden Girls LEGO set! I am a TENTE person but… this is really fun!