Jon Aquino's Mental Garden

Engineering beautiful software jon aquino labs | personal blog

Saturday, July 20, 2013

Why does the world exist?

Why does the world exist?

Tuesday, July 16, 2013

Notes on using the Clown Car Technique in IE

The Clown Car Technique is a clever way to implement responsive images by stuffing a big blob of SVG into an <object> tag.

Below are some tips and tricks for making it work properly in IE and making it clickable.

To make it work properly in IE:

  • Pull the fallback image outside of the <object> tag and use conditional comment to display either the <object> or the fallback image. Putting the fallback image inside the <object> tag doesn't seem to work in IE8 - note that Estelle's demo shows a broken image in IE8.

<!--[if (gt IE 8)|(!IE)]><!-->
<object data="data:image/svg+xml,{{urlEncodedSvg}}" type="image/svg+xml"></object>
<!--<![endif]-->
<!--[if lte IE 8]>
{{fallbackImage}}
<![endif]-->

  • On the <object>, specify a width (e.g., width: 100%; or width: 50%;). If you do not specify a width, the height will stay at about 100px for some reason. This is what Estelle does in her clown-car demo.
  • Also on her clown-car demo, Estelle sets the URLs to https rather than http. Otherwise, you get "SEC7111: HTTPS security is compromised" errors in the IE console. That said, the errors don't seem to be user-facing...

To make it clickable:

  • Put <a> around the fallback image.
  • Add xmlns:xlink="http://www.w3.org/1999/xlink" to the <svg> element, and put the following inside the <svg> element, replacing {{href}}, {{width}}, and {{height}} with your values. This will add the link behavior for Firefox, Chrome, and Safari.

<a xlink:href="{{href}}" target="_top">
<rect x="0" y="0" width="{{width}}" height="{{height}}" fill="red" fill-opacity="0" stroke="none" />
</a>

  • For IE, put the following on the <object> (replacing {{href}} with your URL): onclick="window.location = '{{href}}';"
  • Also for IE, on the <object>, specify cursor: pointer;

Saturday, July 13, 2013

On Purpose in the Universe

Atheism doesn't work for me because it is connected to the idea that there is no purpose in the universe, no purpose in a person's life. Aristotle, on the other hand, argues that purpose is a fundamental part of reality (one of his Four Causes).

I fully agree with something that Steve Jobs said in his Stanford commencement address: "You can't connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something - your gut, destiny, life, karma, whatever." In atheism, you can't have that magic. You are pitted against a hostile environment of random chance, illness, and misfortune. But in Catholicism, there is purpose: purpose in good things, and God can even pull good out of evil things. It is about life, hope, love, and flourishing; in other words, purpose. And I like that.

Monday, July 01, 2013

Continuing quest to wean myself off Google services

I found a good replacement for google.com and the Chrome browser, and they are both from Yandex, which is a search engine based in Russia. (Those Russians are smart!)

Replacement for google.com: yandex.com. It seems to give better search results than DuckDuckGo... maybe. I'm continuing to try it out, but it is looking good so far.

Replacement for Chrome: Yandex browser. It is based on the open-source Chromium project. (Review.) And you can install 1Password on it via the Chrome web store.