Games, Programming, Web
chrisdanford
I'm a computer programmer specializing in games and fitness applications.
Homepage: http://www.chrisdanford.com
Posts by chrisdanford
The difference between smart quote and apostrophe
Jan 5th
Improper use of “smart quotes” (aka “slanty quotes”, “curly quotes”) came up in a code review. Get Smart with Smart Quotes was a great resource. Here are some quick take-aways:
- Smart quotes consist of an open and a closed version (also referred to as left and right quotes).
- Don’t confuse apostrophe (‘) with a single quotation mark (‘).
- Contractions should use the apostrophe character.
- There are named HTML entities for smart quotes: ‘ (‘) ’ (’) “ (“) ” (”)
Of small fonts, blink rates, and eye strain
Dec 26th
tl;dr: A low blink rate can cause irritated eyes (“eye strain”). Small fonts, poor type contrast, and poor typography all contribute to low blink rates. Eye strain is not permanent.
Several people, after seeing the small fonts on my laptop (2560 x 1600 on a 13″ screen), have told me that I’m “hurting” or “damaging” my eyes my using such small type. I haven’t ever had eye strain symptoms and wasn’t sure whether to be worried.
First, and most importantly, eye strain doesn’t appear to be permanent.
“Despite popular belief, sitting too close to the television, or in this case the computer, won’t cause blindness or other permanent damage,” said Dr. Kimberly Yen, assistant professor of ophthalmology at BCM. “What it can do is cause eye strain symptoms.”
When eyes are focused on one item for a long period of time, whether it’s a computer screen, television or even a book, the blink rate slows. That could lead to eyes feeling dry or uncomfortable. Vision could even begin to blur or double. One common side effect of eye strain is headache.
source: Baylor College of Medicine
A great article at Eye Magazine (a graphic design magazine) breaks down specific stressful conditions:
- reading small text sizes
- reading low-contrast gray text
- reading with a light source behind the reading material to cause glare
- reading from too close a distance, which causes the eyes to point inward towards each other (convergence stress)
- reading from variable focal distances (accommodative stress)
- reading while wearing glasses that simulate an astigmatism (refractive stress)
Small text sizes, low contrast, glare and refractive stress all resulted in increased activity in the orbicularis oculi, while convergence stress and accommodative stress did not, though after reading in these two conditions, readers are more likely to report headaches and pain coming from behind the eye. Stressors such as small text size and glare are reported as irritation on the front of the eye.
Blink rate is a key factor in eye stress. Difficult-to-read text (e.g. small text) causes a lower blink rate.
Light grey text on a white background and small text size both lead to an increased orbicularis oculi activity and decreased blinking. These two conditions are related to text quality, and we would expect to find similar indicators of eye fatigue with poor font quality or condensed letter spacing. To reduce this type of eye strain, we need text of the highest possible quality.
…other studies found that we blink far more often under relaxed conditions than while reading: 22 blinks per minute while relaxed, versus ten blinks per minute while reading a book. A recent study at Pacific University illuminated why blinking is suppressed during reading. Tai and Sheedy found that the eye movement following a blink was far more likely to be a regressive or backward corrective eye movement than one that did not follow a blink.
I’ll be sticking with small fonts for now. If I experience eye strain though, it’s good to know that cranking up the font size can offer some relief.
Essential JavaScript links
Jul 2nd
This is a continuously updated list of JavaScript articles and resources that I recommend to other Amazon developers.
- MicroJS – a directory of JavaScript micro libraries
- PhantomJS – headless, scriptable WebKit for unit, integration, and load testing
- 10 things I learned from the jQuery source - a mini code walkthrough of jQuery
- When Automatic Semicolon Insertion goes bad
- ==, ===, and type coercion
- Guide to authoring jQuery plugins - good patterns and anti-patterns for jQuery plugins
- The JavaScript style guide used by jQuery Core - a short and sweet style guide
- Using event capturing to improve page load times - delay initialization for as long as possible
- Async JS with Deferreds – Express asynchronous logic concisely
Essential CSS links
Jun 13th
This is a continuously updated list of CSS articles that I recommend to other Amazon developers.
- CSS3 units and their uses
- CSS selector specificity - determines the order in which rules are applied to an element
- SASS vs LESS throwdown - how to choose a CSS preprocessor
- Sassy Mother Effing Text Shadow - behold the power of SASS
- Twitter Bootstrap – lightweight, full-featured, componentized CSS library with awesome documentation
- SASS - popular CSS preprocessor with great documentation
- Compass home - a library full of reusable CSS best-practices, built on SASS
- When to use !important
- WebKit accelerated rendering and compositing - an explanation of WebKit’s RenderLayer tree and z-index tree
- Crazy Town – avoiding overly-specific selectors
Getting started with Ruby on Rails
Apr 3rd
These are some of the tutorials and guides I’ve found most helpful while picking up Ruby on Rails 3.
Ruby language:
- http://strugglingwithruby.blogspot.com/2008/11/contents-page.html
- http://www.zenspider.com/Languages/Ruby/QuickRef.html
Installing Rails on Windows:
Best “my first app” walk-through:
Using “remote” to ajaxify links and forms:
- http://www.alfajango.com/blog/rails-3-remote-links-and-forms/
- http://www.alfajango.com/blog/rails-3-remote-links-and-forms-data-type-with-jquery/
“Unobtrusive JS” library that ships with Rails 3:
- http://www.slideshare.net/philcrissman/ujs-in-rails-3-6775992
- http://www.alfajango.com/blog/rails-jquery-ujs-now-interactive/
Use Twitter Bootstrap with Rails:
iCatcher! podcatcher app for iOS – mini review
Mar 16th
I recently found a new favorite podcatching app called iCatcher! (the exclamation is theirs, but I share their enthusiasm). The selling points for me are:
- over-the-air downloads aren’t subject to the 50MB iTunes Store OTA download limit
- 30 second skip button for video (not just audio), and a 30 second rewind button
- plays video in portrait orientation
- a sleep timer
- if you’re playing a video and you lock the device, the video’s audio will continue to play
- play video files back at 2x speed (a feature that iTunes Mobile supports only for audio files)
I can’t express how excited I am about that last feature. The app has been working as advertised so far – no crashes or bugs. iCatcher is $2 in the App Store.
Get Chrome “Side Tabs” back (kind of)
Mar 13th
Thousands of people, including myself, cried out in terror when Google removed the “Side Tabs” from Chrome. I tried for one month to settle into Firefox + Firebug + Tree Style Tabs as my main browser, but that combination is nowhere near is snappy as Chrome for my workload.
My workaround has been to use the most recent build of Chromium (Chrome’s open-source alter ego) that still contained the Side Tabs feature. Because there are no security updates available for this version, I use NoScript and whitelist scripting on sites as needed.
Chromium 15.0.862.0 – Windows: chrome-win32.zip, Mac: chrome-mac.zip
A major advantage of using Chromium instead of an old version of Chrome that has Side Tabs is that Chromium can be run side-by-side with the latest version of Chrome.
GreaseMonkey Script: Larger Netflix Silverlight Player
Dec 27th
Eliminate the large, wasteful black margin around the Netflix Silverlight player.
Install it at userscripts.org. Firefox users will need to install GreaseMonkey.
The best method to download YouTube videos
Dec 17th

I like to download lectures and presentations from YouTube so that I can play them back using VLC at 2x playback speed.
My favorite option for downloading is this YouTube video download GreaseMonkey script that adds a download button to the YouTube video page. It works in Chrome, and in Firefox with GreaseMonkey. This is vastly superior to the more-popular YouTube video save sites that require to you execute a sketchy Java applet.




