Lately I’ve been more interested in writing Bash. However, as cool as Bash is for being able to pipe data all over the place, it has a really hard to read syntax. This makes understanding people’s 1000 line long Bash file tedious.
The more utility functions, aliases, and slight tweaks I add to my profile, the longer I have to spend each time I come back to it. I recently split out each of the sections into their own files to fix this.
My new profile is much shorter and is very clear.
# export...
This is a short one. On the Pixie landing page I was trying to use jQuery to focus on a game embedded via an iFrame. I tried
$ ->
$('iframe').contents().find('canvas').focus()
but that didn’t work.
It turns out to get this working you need setTimeout. I guess the browser isn’t done loading the iFrame contents by the time jQuery says the DOM is ready.
$ ->
setTimeout ->
$('iframe')[0].contentWindow.focus()
, 100
Here’s the related Stack Overflow question
I hate making elements on web pages draggable. I think it’s a gross UI choice. However, sometimes it makes sense.
Recently, I’ve been working on making a bunch of interactive tooltips to help people get familiar with our game development tools on Pixie. It’s pretty convenient for the user to move these things around in order to see different parts of the code as they read the tips.
On some of these tooltips I have code samples, which should be selectable so that people can copy the snippets...
I recently had a situation where I wanted to use jQuery’s data method to convert one of my HTML data-attribute values into an array.
I ran into trouble when I tried to use the returned data as an array. The problem was that my data-attribute wasn’t valid JSON because I had double quoted the attribute value instead of single quoting it. As a result, jQuery was parsing it as a string rather than an array.
Here’s a demonstration of what was going on: http://jsfiddle.net/EgbUh/6/
Don’t let this...
As part of the Pixie redesign, Daniel and I decided we wanted an “App” dock as the primary site navigation. Without performing our design due diligence how could we expect to synergize the feel of the site and incentivize our community to shift the paradigm in our favor? #Monetize
I looked around and found a good example of an OS X style dock in css by the folks at Zurb. I make no claims to the originality of my work. These guys deserve all the credit.
The sample css was clear but once implemented...