<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Russell Heimlich &#187; Coding</title>
	<atom:link href="http://www.russellheimlich.com/blog/tags/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.russellheimlich.com/blog</link>
	<description>The Blog of Russell Heimlich</description>
	<lastBuildDate>Mon, 30 Jan 2012 04:16:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Unmatched Style&#8217;s CSS Off Was Slimey Fun</title>
		<link>http://www.russellheimlich.com/blog/unmatched-styles-css-off-was-slimey-fun/</link>
		<comments>http://www.russellheimlich.com/blog/unmatched-styles-css-off-was-slimey-fun/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 17:47:59 +0000</pubDate>
		<dc:creator>Russell Heimlich</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[contest]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[cssoff]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Knucklelodeon]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[Triple Dare]]></category>
		<category><![CDATA[UnmatchedStyle]]></category>

		<guid isPermaLink="false">http://www.russellheimlich.com/blog/?p=2537</guid>
		<description><![CDATA[UnmatchedStyle.com hosted a CSS competition for front-end devs to strut their stuff among their peers. Everyone got the same design and it was up the entrant to come up with the most efficient, pixel-perfect, bleeding-edge, fully functioning interpretation. The deceptively simple looking design was lovingly crafted by the rowdy folks of Paravel and sent out two weeks ago. Entries were [...]<p><a href="http://www.russellheimlich.com/blog/unmatched-styles-css-off-was-slimey-fun/">Unmatched Style&#8217;s CSS Off Was Slimey Fun</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></description>
			<content:encoded><![CDATA[<p>UnmatchedStyle.com hosted a <a href="http://www.unmatchedstyle.com/cssoff/">CSS competition</a> for front-end devs to strut their stuff among their peers. Everyone got the same design and it was up the entrant to come up with the most efficient, pixel-perfect, bleeding-edge, fully functioning interpretation. The <a href="http://www.unmatchedstyle.com/cssoff/signup.php">deceptively simple looking design</a> was lovingly crafted by the rowdy folks of <a href="http://paravelinc.com/">Paravel</a> and sent out two weeks ago. Entries were due at 5pm today. Here&#8217;s the low down on my submission.</p>
<p>First, you should probably play around with <a href="http://kingkool68.com/cssoff2011/">my finished design</a> and compare it with the static mockup (linked above). Go check it out&#8230; I&#8217;ll wait. Did you drag the corner of the browser to check how it responds to different browser sizes? Of course you did you CSS nerd.</p>
<ul>
<li> Somehow I messed up the colors of the design. My layout has really bright colors while the original design uses more muted colors. I have no idea how this happened.</li>
<li>The logo is a background image attached to the element of the section. I was inspired by <a href="http://html5forwebdesigners.com/">html5forwebdesigners.com</a>.</li>
<li>I forgot to add the blue faded slime splat in the header. I kind of screwed myself by using the &lt;head&gt; and &lt;header&gt; elements in the same section though I could have attached it to the &lt;HTML&gt; element. Oh well.</li>
<li>Instead of PNGs I used GIFs in some places due to the smaller file size (thanks to increasing the Lossy section in Photoshop&#8217;s Save For Web dialog) <img class="alignnone size-full wp-image-2542" title="GIF vs PNG Compression" src="http://www.russellheimlich.com/blog/wp-content/uploads/2011/11/GIF-vs-PNG.gif" alt="" width="599" height="517" /></li>
<li>Navigation links are at the bottom of the page with position:fixed (sticks to the top of the viewport) set for larger screens and an anchor link to the bottom of the page for smaller screens.</li>
<li>The obstacles section is built with two sprites using the same background-position offsets. I wanted to just use one sprite for the larger images and use background-size to scale them down for the thumbnails. Performance took a big hit so I simplified.</li>
<li>The larger obstacle images are within a<br />
<section>element with overflow:hidden applied. The thumbnails link to the IDs of the larger version so no JavaScript is required to show/hide them.</section>
</li>
<li>The labels for the prizes that appear on hover are pulled from the title attribute of the link dynamically using CSS.</li>
<li>The form uses required and pattern attributes for validation without any JavaScript. If I had more time I would add a validation script as a fallback.</li>
<li>When the countdown reaches zero I &#8220;slime&#8221; the user using a number of slime splat images already loaded in the design.</li>
<li>The two addresses to the studios are marked up with a vCard microformat so machines can easily parse that information.</li>
<li>I did not use the &lt;address&gt; element for the studio addresses because that is not what it is for.</li>
<li>The custom &lt;select&gt; drop down styles are images with the invisible &lt;select&gt;&#8217;s laid overtop. They&#8217;re not useable for sighted keyboard users. This is probably my least favorite part of my design.</li>
<li>I focused much of my time on making the design accessible and didn&#8217;t even bother checking what it looks like in browsers outside of Firefox 7, Chrome 15, and Safari 5 (all Mac versions). I just didn&#8217;t have enough time.</li>
<li>This layout is sluggish on my Nexus One most likely due to the way I added the semi-transparent grainy texture.</li>
<li>I added some ASCII art as an HTML comment at the bottom of the page. I like adding little easter eggs like that. <img class="alignnone size-full wp-image-2544" title="ASCII Slime Splat HTML Comment" src="http://www.russellheimlich.com/blog/wp-content/uploads/2011/11/ASCII-splat.png" alt="" width="600" height="636" /></li>
<li>Finding the right element to make a favicon image from was tricky. I settled on the KN from the Knucklelodeon logo because it looked the best at 16&#215;16.</li>
<li>You can pin the site to your desktop if you&#8217;re using IE9 and Windows 7 since I added a fewelements. Of course I forgot to add the more basic description, keyword and other general elements.</li>
<li>Selecting text uses the same colors as the hove styles, yellow background with reddish-orange text and no text shadow.</li>
<li>My custom JavaScript code is in a single block at the bottom of the page and not in a separate file. Since it is a single-page site, there is no benefit to externally linking it.</li>
</ul>
<p>This was also my first responsive design. I started out making the large 1024px version first and then going back to make smaller versions. Big mistake. It&#8217;s a lot easier to start with <a href="http://www.lukew.com/resources/mobile_first.asp">mobile first</a> and then build your design up, larger and larger. Media queries are also a pain in the butt since it requires a ton of going back and forth from the top of the stylesheet to the bottom where the media query styles were. When I changed styles for one target size, I had to double-check that those changes didn&#8217;t (or did) cascade into the larger sizes. This also resulted in a lot of duplicate selectors. What would be ideal is to set-up different classes on the HTML element with a class for different resolutions. This would be similar to how we handle <a href="http://html5boilerplate.com/docs/The-markup/#ie-html-tag-classes">conditional styles for Internet Explorer</a>. This way we could group similar styles in the same area which makes it easier to keep track of changes.</p>
<h2>Sites I Referenced</h2>
<ul>
<li><a href="http://cssglobe.com/post/8802/custom-styling-of-the-select-elements">Custom styling of select boxes</a></li>
<li><a href="http://spritegen.website-performance.org/">Handy CSS Sprite Generator </a></li>
<li><a href="http://www.fluid-blog.com/2008/02/22/converting-tracking-and-leading-from-photoshop-to-css/">Converting kerning to letter-spacing</a></li>
<li><a href="http://www.css3.info/preview/background-size/">background-sizing CSS property</a></li>
<li><a href="http://www.standardista.com/css3/css3-background-properties/">Support background properties among browsers</a></li>
<li><a href="http://davidwalsh.name/html5-placeholder">HTML5 Placeholder</a></li>
<li><a href="http://www.mightymeta.co.uk/1269/css-noise/">Using pseudo elements to add texture</a></li>
<li><a href="https://github.com/h5bp/html5-boilerplate">HTML5 Boiler Plate</a></li>
<li><a href="http://mattkersley.com/responsive/">Responsive Design Testing</a></li>
<li><a href="http://www.the-art-of-web.com/html/html5-form-validation/">HTML5 Form Validation</a></li>
<li><a href="http://html5pattern.com/">HTML5 Patterns for Validation</a></li>
<li><a href="http://css-tricks.com/6555-css-content/">CSS3 Content from Attributes</a></li>
<li><a href="http://html5forwebdesigners.com/">HTML5 For Web Designers</a></li>
<li><a href="http://html5doctor.com/the-address-element/">The &lt;address&gt; element</a></li>
<li><a href="http://mathiasbynens.be/notes/touch-icons">Everything You Wanted To Know About Touch Icons</a></li>
<li><a href="http://photo2text.com/">Photo2Text.com for Generating ASCII Art</a></li>
</ul>
<h2>Other Noteworthy Entries</h2>
<p>So what do people do once the contest comes to an end? Share their work on Twitter for others to comment on of course!  Here are some of the other entries I found searching Twitter for <a href="https://twitter.com/search/%23cssoff">#cssoff</a>.</p>
<ul>
<li><a href="http://timhettler.com/cssoff/">The Triple Dare logo follows your mouse</a> <a href="https://twitter.com/timhettler">@timhetter</a></li>
<li><a href="http://paulwelsh.info/cssoff/">Slick color picker for Select Team Color</a> <a href="http://www.twitter.com/spacedawwwg">@spacedawwwg</a></li>
<li><a href="http://madebymufffin.com/csshappy/">Creative way for showing the Obstacles section at different browser resolutions</a> <a href="http://twitter.com/mbmufffin">@mbmufffin</a></li>
<li><a href="http://www.brandonewoldt.com/cssoff/index.html">Vertical parallax effect that breaks on my 27 inch iMac</a> <a href="http://www.twitter.com/brandonewoldt">@brandonewoldt</a></li>
<li><a href="http://dl.dropbox.com/u/3142994/cssoff2011/index.html">Interesting Signup Form Animation</a> <a href="http://www.twitter.com/leonuh">@leonuh</a></li>
<li><a href="http://www.loganfranken.com/projects/cssoff/">Awesome sliming at the end of the countdown</a> <a href="http://www.twitter.com/loganfranken">@loganfranken</a></li>
<li><a href="http://steamdev.com/cssoff/">Lots of different animations</a> <a href="http://www.twitter.com/strTRK">@strTRK</a></li>
</ul>
<p>Finally if you want to show off your entry, <a href="https://twitter.com/#!/daljo628/status/132253988782489600">@daljo628 is hosting them</a> at <a href="http://knucklelodeon.com/">http://knucklelodeon.com/</a> Ping him to have yours added.</p>
<p>Phew! I&#8217;m glad I&#8217;m not in the judge&#8217;s shoes now. Having to go through all the entries and ultimately pick a winner; That&#8217;s a tough call.</p>
<p><a href="http://www.russellheimlich.com/blog/unmatched-styles-css-off-was-slimey-fun/">Unmatched Style&#8217;s CSS Off Was Slimey Fun</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.russellheimlich.com/blog/unmatched-styles-css-off-was-slimey-fun/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dummyimage.com Can Calculate Ratios Now</title>
		<link>http://www.russellheimlich.com/blog/dummyimage-com-can-calculate-ratios-now/</link>
		<comments>http://www.russellheimlich.com/blog/dummyimage-com-can-calculate-ratios-now/#comments</comments>
		<pubDate>Mon, 30 May 2011 14:21:00 +0000</pubDate>
		<dc:creator>Russell Heimlich</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Dummyimage.com]]></category>
		<category><![CDATA[aspect ratio]]></category>
		<category><![CDATA[calculations]]></category>
		<category><![CDATA[dummyimage.com]]></category>
		<category><![CDATA[features]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[ratio]]></category>

		<guid isPermaLink="false">http://www.russellheimlich.com/blog/?p=2499</guid>
		<description><![CDATA[Thanks to Duncan Stephen&#8217;s blog post about dummy images, I was inspired to add a new feature. All of the customisation options have got us excited, but I can think of a few more features that would improve it even further. The ability to set a width and an aspect ratio, for those times when [...]<p><a href="http://www.russellheimlich.com/blog/dummyimage-com-can-calculate-ratios-now/">Dummyimage.com Can Calculate Ratios Now</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-2500" title="Ratios Rock!" src="http://www.russellheimlich.com/blog/wp-content/uploads/2011/05/Ratios-Rock.png" alt="" width="600" height="480" /></p>
<p>Thanks to Duncan Stephen&#8217;s <a href="http://stawebteam.wordpress.com/2011/03/02/creating-quick-and-easy-placeholder-images/">blog post about dummy images</a>, I was inspired to add a new feature.</p>
<blockquote><p><em>All of the customisation options have got us excited, but I can think of a few more features that would improve it even further.</em></p>
<p><em>The ability to set a width and an aspect ratio, for those times when you  know you need a 16:9 image but just can’t be bothered to get the  calculator out.</em></p></blockquote>
<p>What a great idea! It took me an hour or two to thoroughly test the new feature to my satisfaction and push it live. I&#8217;ve also updated the documentation and source code for anyone who wants to take a look to see how it&#8217;s done.</p>
<p>You can use aspect ratios with the width like so:</p>
<p><a href="http://dummyimage.com/640x4:3">http://dummyimage.com/640&#215;4:3</a></p>
<p>or with the height</p>
<p><a href="http://dummyimage.com/16:9x1080">http://dummyimage.com/16:9&#215;1080</a></p>
<p>I enjoy adding new features that make a designer/developers life a bit easier. If you have something that you would like to see dummyimage.com do, let me know!</p>
<p><a href="http://www.russellheimlich.com/blog/dummyimage-com-can-calculate-ratios-now/">Dummyimage.com Can Calculate Ratios Now</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.russellheimlich.com/blog/dummyimage-com-can-calculate-ratios-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The History Of Dummyimage.com</title>
		<link>http://www.russellheimlich.com/blog/the-history-of-dummyimage-com/</link>
		<comments>http://www.russellheimlich.com/blog/the-history-of-dummyimage-com/#comments</comments>
		<pubDate>Sat, 01 Jan 2011 00:26:46 +0000</pubDate>
		<dc:creator>Russell Heimlich</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Dummyimage.com]]></category>
		<category><![CDATA[case study]]></category>
		<category><![CDATA[dummyimage.com]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[launch]]></category>
		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://www.russellheimlich.com/blog/?p=2447</guid>
		<description><![CDATA[As 2010 is wrapping up, I decided to take some time to chronicle the history of one of my biggest web development milestones of the year. In December of 2006, I started my first real job out of college as a frontend developer at USNews.com. My first big project was to turn a new site [...]<p><a href="http://www.russellheimlich.com/blog/the-history-of-dummyimage-com/">The History Of Dummyimage.com</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></description>
			<content:encoded><![CDATA[<p>As 2010 is wrapping up, I decided to take some time to chronicle the history of one of my biggest web development milestones of the year.</p>
<p>In December of 2006, I started my first real job out of college as a  frontend developer at <a href="http://www.usnews.com">USNews.com</a>. My first big project was to turn a new  site design from a collection of Photoshop documents into functioning <abbr title="Hypertext Markup Language">HTML</abbr> and <abbr title="Cascading Style Sheets">CSS</abbr> code.  I had to slice up dummy images to put into the layouts. As the redesign  process wore on, sizes of elements changed ever so slightly meaning I  needed to make new images with each iteration. I had wished there was a way  to conjure up these placeholder images on the fly. I ended up tucking  that idea away in the back of mind.</p>
<p>For whatever reason I decided to purchase the domain <a href="http://dummyimage.com">dummyimage.com</a> on  the 20th of July, 2007. I can&#8217;t remember if I had some early prototype  version working by then but I had made up my mind that I was going to do  something with this idea. Like most tinkering web devs, I have a stable  of domains for other ideas sitting around until one day when I can get  around to them. Dummyimage.com was not like those other ideas.</p>
<p>Fast forward to August 11th, 2007, when I attended my <a href="http://www.russellheimlich.com/blog/barcamp-dc-wrap-up/">first Bar Camp  in Washington DC</a>. I had mentioned my dummy image idea to <a href="http://twitter.com/jgarber">Jason Garber</a> and  <a href="http://twitter.com/jcarbaugh">Jeremy Carbaugh</a> in passing. They said it was a cool idea and should be  pretty easy to do.</p>
<p>From then on, I was determined to figure out how to make my idea  work. Aside from toying around in <a href="http://www.wordpress.org">WordPress</a> (which resulted in this blog  you&#8217;re reading now) I had zero experience with <abbr title="Hypertext Preprocessor">PHP</abbr>.  I was quite comfortable with JavaScript however and found PHP easy to pickup.  On August 26th, 2007, I had <a href="http://www.russellheimlich.com/blog/dynamically-create-dummy-images-at-any-size/">launched my first version of dummyimage.com</a>.</p>
<p><img class="alignnone size-full wp-image-2449" title="Dummyimage.com Version 1" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/12/dummyimage.com-v1.png" alt="" width="600" height="486" /></p>
<p>The first release was as simple as could be. The only thing you  could change were the dimensions of the images. Everything was a gray  background with the size of the image in centered black Arial text. I  released the source code via a no-frills zip archive for anyone to take  it and do what they wanted. I didn&#8217;t even bother with a design for the site itself thinking only a handful of people would even see it.</p>
<p>Around December of 2009 I began  toying with some new capabilities for dummyimage.com. The biggest  request I got was for the ability to change the colors of the background  and text. I didn&#8217;t really see the point so I sat around on the new  changes. Then on January 25th, 2010. My friend Charlie Park (whom I met  at the first DC Bar Camp in 2007) <a href="http://twitter.com/charliepark/status/8222003586">tweeted</a> out a link mentioning  dummyimage.com My site made its way through the developer community <a href="http://www.russellheimlich.com/blog/dummyimage-com-sees-a-surge-in-interest/"> like wildfire</a> thanks to <a href="http://news.ycombinator.com/item?id=1077013">HackerNews</a>, and Twitter. Suddenly I felt the  need to get working on new features and a redesign for dummyimage.com  based on the feedback that was pouring in.</p>
<p>On March 10th, 2010,  (Chuck Norris&#8217; Birthday &amp; <a href="http://dayofawesomeness.com/">International Day of Awesomeness</a>) I launched<a href="http://www.russellheimlich.com/blog/dummyimage-com-gets-new-features/"> version 2 of dummyimage.com</a>.This added color options, the ability to  customize the text displayed on the image, and a simple form on the  homepage to make generating custom dummy images easier. I switched the  typeface from Arial to a completely free and open font called <a href="http://mplus-fonts.sourceforge.jp/">M+</a>. I also  released the source code under the liberal <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a> based on feedback  I had gotten.</p>
<p>I wanted the new dummyimage.com look to be a little rebellious. Most sites are centered align in relation to the browser. I deliberately made the dummyimage.com homepage align to the right. You can really notice this the larger your monitor&#8217;s resolution is. One person even sent me an e-mail providing a CSS tweak to make it center align. He thought I had made a mistake.</p>
<p><img class="alignnone size-full wp-image-2450" title="Dummyimage.com Version 2" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/12/dummyimage.com-v2.png" alt="" width="600" height="671" /></p>
<p>Since other people were doing other things with  the dummyimage idea like making plugins for text editors and different  platforms, I decided to curate those and <a href="http://dummyimage.com/#other-downloads">link to them from  dummyimage.com</a> I was happy to see my idea taking hold with the  community, even spreading to non-english areas of the web. I guess the  simplicity of my little project transcends language barriers.</p>
<p>Dummyimage.com gets about 10,000 unique visits to it&#8217;s one and only page. It&#8217;s single largest day of traffic was January 26th, 2010, with 15,766 unique visits. Of course most of the traffic comes from people embedding images into their pages. I get about 5.8 million requests (pageviews essentially) for a total of 11.4 gigabytes of bandwidth in a typical month. I have gigs and gigs of server logs to analyze if I really wanted specifics but I leave <a href="http://dummyimage.com/stats/">dummyimage.com&#8217;s server stats</a> open for anyone to take a look at.</p>
<p><a href="http://dummyimage.com/stats/"><img class="alignnone size-full wp-image-2452" title="Dummyimage.com Traffic Stats for January to February 2010" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/12/dummyimage.com-traffic-stats-jan-feb-2010.png" alt="" width="600" height="142" /></a></p>
<p>With the redesign I aimed to make a little extra change by placing 3 ad units to the left. They probably bring in a couple dollars a month via Amazon.com referrals. I don&#8217;t really pay attention to that stuff.</p>
<p>So all in all I&#8217;m  happy with where dummyimage.com has come and it makes for a great  milestone in 2010. Hopefully in 2011 I can manage to launch even bigger  projects I have in mind.</p>
<p><a href="http://www.russellheimlich.com/blog/the-history-of-dummyimage-com/">The History Of Dummyimage.com</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.russellheimlich.com/blog/the-history-of-dummyimage-com/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Trials And Tribulations Of 10KB</title>
		<link>http://www.russellheimlich.com/blog/the-trials-and-tribulations-of-10kb/</link>
		<comments>http://www.russellheimlich.com/blog/the-trials-and-tribulations-of-10kb/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 02:14:23 +0000</pubDate>
		<dc:creator>Russell Heimlich</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[10k Apart]]></category>
		<category><![CDATA[card game]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[optimize]]></category>
		<category><![CDATA[packer]]></category>
		<category><![CDATA[war]]></category>

		<guid isPermaLink="false">http://www.russellheimlich.com/blog/?p=2259</guid>
		<description><![CDATA[JavaScript is a fun language. It lets you build almost anything you can imagine. For some reason, I thought it would be fun to build a simulator for the card game War. I started hacking away on the idea in my spare time. It was also a good excuse to learn object-oriented JavaScript to make [...]<p><a href="http://www.russellheimlich.com/blog/the-trials-and-tribulations-of-10kb/">The Trials And Tribulations Of 10KB</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-2261" title="A Pile of playing Cards" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/08/pile-of-playing-cards.jpg" alt="" width="420" height="315" /></p>
<p>JavaScript is a fun language. It lets you build almost anything you can imagine. For some reason, I thought it would be fun to build a simulator for the <a href="http://en.wikipedia.org/wiki/War_%28card_game%29">card game War</a>. I started hacking away on the idea in my spare time. It was also a good excuse to learn <a href="http://www.edesignerz.net/html/8726-object-oriented-javascript-for-beginners">object-oriented JavaScript</a> to make my card game simulator flexible and modular. After a few weekends I had something that worked (screenshot below). Unfortunately after that life got busy and my war simulator just sat there collecting virtual dust for more than a year.</p>
<p><img class="alignnone size-full wp-image-2263" title="First version of JavaScript War Game" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/08/first-version-of-JavaScript-war.png" alt="" width="348" height="376" /></p>
<p>Fast forward to July 29th when the <a href="http://www.zeldman.com/2010/07/29/10k-apart-%E2%80%93%C2%A0inspire-the-web/">10K Apart contest is launched</a> challenging developers to build compelling apps that are 10 kilobytes or less. This would be a fun way to refine my stale war game simulator as well as test my JavaScript coding-foo to squeeze it all in to 10 kilobytes.</p>
<h3>Pure HTML Cards</h3>
<p>One of my first challenges was re-doing the cards. Initially I constructed a single-image sprite containing <a href="http://dev.kingkool68.com/war/classic-playing-cards.png">all of the cards</a>. JavaScript would manipulate the class of a div which would determine how to position the image for the proper card to be displayed. This method led me to discover something <a href="http://www.russellheimlich.com/blog/ie-gets-a-css-rule-right/">Internet Explorer actually gets right</a> with CSS and the other browsers fall short. This image of all of the cards weighed in at 36KB alone. Ouch!</p>
<p>My solution was to use<a href="http://www.fileformat.info/info/unicode/char/2660/index.htm"> unicode characters</a> for the different suites and letters and numbers for the card values. Child elements of the card held the symbols and I positioned them absolutely within the card element. The final touch was to rotate one of the child elements 180 degrees using the <a href="http://www.useragentman.com/blog/2010/03/09/cross-browser-css-transforms-even-in-ie/">transform CSS property</a> so it would display upside down just like a real card. My image-less approach was just a fraction of the size of using images for cards. But something was still missing.</p>
<p><a href="http://tweetimag.es/"><img class="alignnone size-full wp-image-2260" title="http://tweetimag.es Sizing Options" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/08/tweetimag.es-options.png" alt="" width="570" height="240" /></a></p>
<p>Playing cards have decorative designs in the middle. It would be too complicated to completely replicate these designs so I came up with the idea to use a Twitter avatar as a background. Thanks to the awesome service provided by <a href="http://tweetimag.es/">http://tweetimag.es/</a> their RESTful api let me grab any public Twitter users avatar by constructing a simple URL. Browsers provide an easy way to  <a href="http://www.quirksmode.org/dom/w3c_css.html#change">add new CSS rules to a stylesheet</a> via JavaScript so I could dynamically change the background image of a card based on which Twitter names the user provided. This is where the idea for making my War game simulator revolve around Twitter users was born.</p>
<h3>Viral Sharing</h3>
<p>A bigger advantage to hooking into Twitter is it makes each game more personal for the player. Pitting two people in a card game battle makes the experience more meaningful then a bunch of plain, virtual playing cards flipping back and forth for a couple hundred of turns. This also has the potential for a viral aspect to my app since I already have atleast two Twitter names that would be interested in the results. In order to share a game I needed to create a way to read in the number of players, their twitter name, and their deck at the start of the game. Using a simple string of characters that represented this data attached to the end of the URL allowed me to do this. All of the values in the deck could be stored as a number or letter since I had unique first letters.</p>
<table>
<thead>
<tr>
<th>Card</th>
<th>Encoded Equivalent</th>
</tr>
</thead>
<tbody>
<tr>
<td>0, 1, 2 &#8230; 10</td>
<td>0, 1, 2 &#8230; 10</td>
</tr>
<tr>
<td>Jack</td>
<td>j</td>
</tr>
<tr>
<td>Queen</td>
<td>q</td>
</tr>
<tr>
<td>King</td>
<td>k</td>
</tr>
<tr>
<td>Ace</td>
<td>a</td>
</tr>
<tr>
<td>Hearts</td>
<td>h</td>
</tr>
<tr>
<td>Diamonds</td>
<td>d</td>
</tr>
<tr>
<td>Spades</td>
<td>s</td>
</tr>
<tr>
<td>Clubs</td>
<td>c</td>
</tr>
</tbody>
</table>
<p>Therefore, the Ace of Spades could be represented as &#8216;as&#8217;, the 10 of Diamonds would be &#8217;10d&#8217; and so on. A full game looks like this: p1-kingkool68:adqhkc2d5d10s3h3d5hjs8dqc9c8h2s9d6c7c9skd10d8c7s7d2c4s|p2-naudebynature:jc6d10cjdkh5c4h6sqdks2has6h4d7h4cac10h9hah3s8s5s3cjhqs</p>
<h3>A Heap of Data</h3>
<p><img class="alignnone size-full wp-image-2264" title="Stats from JavaScript War" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/08/stats-from-JavaScript-war.png" alt="" width="600" height="352" /></p>
<p>One of my favorite parts of developing this app was creating a way for keeping track of all the different data that results from a single game. For each war I store the turn it occurred on as well as keep track of which player won the war. After each turn I store a copy of the players deck for further analysis after the game concludes. I originally wanted to include a line graph showing the number of cards a player had in their deck as the game progressed. Building that feature was pretty simple thanks to the <a href="http://www.russellheimlich.com/blog/google-releases-api-for-charts/">Google Charts API</a> but in the end it had to be cut in order to get below the 10KB limit.</p>
<h3>Squeezing Down the Bits</h3>
<p><img class="alignnone size-full wp-image-2262" title="Cat is squished" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/08/cat-is-squished.jpg" alt="" width="500" height="332" /></p>
<p>I was a little ambitious with the functionality that when I was ready to start compressing my code down I was shocked to see my idea bloated to 33KB. That&#8217;s more than 3 times the maximum size. A serious slimming down was in order. Pre-populat lists of Twitter users that would make for interesting battles: cut. Charting capabilities mentioned earlier: gone. A brief blurb explaining the game and who I was: removed. Title tags: discarded. Every little bit I could trim down would help. After all this I was down to about 17KB and along way to go to get under 10KB.</p>
<p>Dean Edwards took JavaScript compression to another level with his <a href="http://dean.edwards.name/packer/">/packer/</a> tool. He came up with away to reduce the size of JavaScript by removing white space, stripping comments, and replacing variables with shorter, less-coherent replacements. <a href="http://www.cleancss.com/">CleanCSS.com</a> does pretty much the same thing but for CSS. Such optimizations include replacing <em>font-weight:bold;</em> with <em>font-weight:700; color:#ff0000;</em> with <em>color:red;</em> and so forth. These packing tricks helped get me to 13KB but I was running out of ways to optimize further.</p>
<p>My next plan was to modify my HTML. IDs like &#8216;prepare-for-war&#8217; became a single letter, &lt;strong&gt; elements were replaced with deprecated &lt;b&gt; tags, and the closing &lt;/body&gt; and &lt;/html&gt; tags were axed since they had no affect on my page. <strong>Sidenote:</strong> Google chops off the closing &lt;/body&gt; and &lt;/html&gt; tags which for a site that serves up that volume of pages results in a savings of a couple million dollars in bandwidth bills every year.&lt;/end sidenote&gt;</p>
<p>At this point I was so close to coming under 10KB but yet so far. It was time for one more drastic technique. I noticed how well the JavaScript /packer/ tool worked so I decided to combine my HTML and CSS into a single line and use JavaScript to write it out to the page as it was loading. This way I could combine it with my main JavaScript code for the most efficient compression possible. After 3 hours of toiling in vain, I reached the point where my app was under the magic limit. Ten kilobytes is equal to 10,240 bytes. My code weighed in at 10,236 bytes; a mere 4 bytes to spare!</p>
<h3>Lessons Learned</h3>
<p>Even after spending hours tediously compressing and optimizing my code, I still had a lot of fun. My biggest challenge wasn&#8217;t squeezing everything down, or getting it all to work just right. Rather my biggest challenge was myself and when to determine it was finished. After each piece of functionality I coded I wound up thinking of two more things to make it even better. Once it was <a href="http://10k.aneventapart.com/Entry/247">submitted to the contest gallery</a>, my app got some luke-warm attention but I&#8217;m used to that now. Personal projects I toil over never get the amount of attention I always think they will. I&#8217;m anxious to see who wins the <a href="http://10k.aneventapart.com/">10K Apart contest</a> and whether my War app gets any mention at all from the judges.</p>
<p>But in the end that doesn&#8217;t matter. What matters is I got my idea out of my head  and into a working state where people could actually try it out, no matter how  trivial of an idea it is. And that is what makes the web such a great platform for  an individual like myself.</p>
<p><a href="http://www.russellheimlich.com/blog/the-trials-and-tribulations-of-10kb/">The Trials And Tribulations Of 10KB</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.russellheimlich.com/blog/the-trials-and-tribulations-of-10kb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>5 Links Of Interestingness</title>
		<link>http://www.russellheimlich.com/blog/5-links-of-interestingness/</link>
		<comments>http://www.russellheimlich.com/blog/5-links-of-interestingness/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 02:04:37 +0000</pubDate>
		<dc:creator>Russell Heimlich</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[WTF]]></category>

		<guid isPermaLink="false">http://www.russellheimlich.com/blog/?p=2211</guid>
		<description><![CDATA[http://0to255.com/ &#8211; &#8220;0to255 cures your color manipulation woes. Simply pick the color that you want to start with and 0to255 gives you a range of colors from black to white using an interval optimized for web design. Then, just click the variation you want to use and the hex code is automatically copied to your [...]<p><a href="http://www.russellheimlich.com/blog/5-links-of-interestingness/">5 Links Of Interestingness</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://0to255.com/"><img class="alignnone size-full wp-image-2212" title="0to255.com screenshot" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/04/0to255.com-screenshot.png" alt="" width="500" height="283" /></a></p>
<p><a href="http://0to255.com/">http://0to255.com/</a> &#8211; &#8220;0to255 cures your color manipulation woes. Simply pick the color that you want to start with and 0to255 gives  you a range of colors from black to white       using an interval optimized for web design. Then, just click the  variation you want to use and the hex       code is automatically copied to your clipboard.&#8221; My favorite part is that it uses a RESTful API so you can do things like <a href="http://0to255.com/0099ff">http://0to255.com/0099ff</a> You know I just love things that you can <a href="http://dummyimage.com/640x480/0099ff/fff/&amp;text=RESTful+APIs+rock!">manipulate with a url</a>.</p>
<p><a href="http://www.cssdesk.com"><img class="alignnone size-full wp-image-2217" title="cssdesk.com screenshot" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/04/cssdesk.com-screenshot.png" alt="" width="600" height="268" /></a></p>
<p><a href="http://cssdesk.com/">http://cssdesk.com/</a> &#8211; A tool for quickly mocking up snippets of HTML/CSS. I would prefer to just create a new HTML file in Dreamweaver and play with it using Firebug, but this could work too. I found the cursor in the HTML/CSS box to be a little off when hitting return. CSSdesk has a nice interface which is almost like a desktop application. And since you can download it and run it locally, I guess it qualifies as a genuine application.</p>
<p><a href="http://www.boston.com/bostonglobe/ideas/articles/2010/04/11/please_do_not_change_your_password/"><img class="alignnone size-full wp-image-2216" title="Post-it with Crossed-off Passwords" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/04/post-it-with-crossed-off-passwords.jpg" alt="" width="189" height="196" /></a><br />
<a href="http://www.boston.com/bostonglobe/ideas/articles/2010/04/11/please_do_not_change_your_password/">Please Do Not Change Your Password</a> &#8211; Alot of security&#8217;s best practices cause more problems than they solve. &#8220;At countless conferences and seminars, experts have consistently called  for more education and outreach as the answer to user apathy or  ignorance. But the research of Herley and others is causing many to  realize most of the blame for noncompliance rests not with users, but  with the experts themselves — the pros aren’t able to make a strong case  for all their recommendations.&#8221;</p>
<p><a href="http://www.smashingmagazine.com/2010/04/10/holistic-web-browsing-4-trends-of-the-future/"><img class="alignnone size-full wp-image-2220" title="Holistic Web Browsing" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/04/holistic-web-browsing.jpg" alt="" width="500" height="300" /></a></p>
<p><a href="http://www.smashingmagazine.com/2010/04/10/holistic-web-browsing-4-trends-of-the-future/">Holistic  Web Browsing: Trends Of The Future</a> &#8211; &#8220;The future of the Web is not at your desk. It’s not necessarily in your  pocket, either. It’s <em>everywhere</em>.&#8221; How do we design for a Web that was only intended to be used in a single context?</p>
<p><a href="http://www.amazon.com/gp/product/B00005Q2ZU?ie=UTF8&amp;tag=thebloofrushe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B00005Q2ZU"><img class="alignnone size-full wp-image-2219" title="Hard Ticket to Hawaii" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/04/hard-ticket-to-hawaii.jpg" alt="" width="360" height="500" /></a></p>
<p><a href="http://www.youtube.com/watch?v=GtQEbFcLHOU" class="broken_link">WTF? (Video)</a> &#8211; &#8220;This clip comes from <a href="http://www.amazon.com/gp/product/B00005Q2ZU?ie=UTF8&amp;tag=thebloofrushe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B00005Q2ZU">Hard Ticket to Hawaii</a>, possibly the worst  1980’s movie made (though to be fair, it’s tagline of Bombs, Babes, and  Beaches is quite… radical).&#8221; At first I thought the acting was WTF, then I saw the ending.</p>
<p><a href="http://twitter.com/chrisrowe/status/11710020273"><img src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/04/seo-and-lightbulbs.png" alt="" title="SEO and Lightbulbs" width="600" height="327" class="alignnone size-full wp-image-2224" /></a></p>
<blockquote><p>&#8220;How many SEO copywriters does it take to change a  lightbulb, light bulb, light, bulb, lamp, bulbs, flowers, flour&#8230;?&#8221;<cite> — <a href="http://twitter.com/chrisrowe/status/11710020273">Chris Rowe</a></cite></p></blockquote>
<p><a href="http://www.russellheimlich.com/blog/5-links-of-interestingness/">5 Links Of Interestingness</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.russellheimlich.com/blog/5-links-of-interestingness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making JavaScript And The Blip.tv Player Work</title>
		<link>http://www.russellheimlich.com/blog/making-javascript-and-the-blip-tv-player-work/</link>
		<comments>http://www.russellheimlich.com/blog/making-javascript-and-the-blip-tv-player-work/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 00:04:44 +0000</pubDate>
		<dc:creator>Russell Heimlich</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[blip.tv]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.russellheimlich.com/blog/?p=2177</guid>
		<description><![CDATA[It sure would be nice if the blip.tv player had an easy way to change which video is playing in a playlist using their JavaScript API. But they don&#8217;t, so I had to roll my own to make the two play together nicely. Here is the end result (Note there are some line breaks I [...]<p><a href="http://www.russellheimlich.com/blog/making-javascript-and-the-blip-tv-player-work/">Making JavaScript And The Blip.tv Player Work</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-2188" title="blip.tv JavaScript API needs work" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/03/blip.tv-javascript-api-needs-work.png" alt="" width="495" height="467" /></p>
<p>It sure would be nice if the blip.tv player had an easy way to change which video is playing in a playlist using their <a href="http://wiki.blip.tv/index.php/Showplayer">JavaScript API</a>. But they don&#8217;t, so I had to roll my own to make the two play together nicely. Here is the end result (Note there are some line breaks I put in here for visual formatting, it might not work):</p>
<pre>var player;
var currentPlaylistItem;
var currentState;
function getUpdate(type, arg1, arg2) {
	switch(type) {
        case "state":
			currentState = arg1;
		break;
		case "item":
			currentPlaylistItem = arg1;
			var episode = player.getCurrentItem();
			document.title = episode.title;
        break;
    }
}

var flashvars = {
	'file': 'http://blip.tv/play/ha0CjMVEh_8o',
    'enablejs': 'true',
    'javascriptid': 'blip_player',
    'autostart': 'false'
};

var params = {
	'allowscriptaccess': 'always',
	'allowfullscreen': 'true',
	'expressinstall': '/millennials/flash/expressInstall.swf'
};

var attributes = {
	'id': 'blip_player',
	'name': 'blip_player'
};
swfobject.embedSWF('http://blip.tv/play/ha0CjMVEh_8o',
'blip_player', '770', '470', '8.0', false, flashvars,
params, attributes, swfCallBack);

function swfCallBack() {
	player = document.getElementById('blip_player');
	$('#agenda h3 a, #agenda a.blip_tv').click(function(){
		var playlistItemNum =
                    $(this).attr('href').split('#')[1];
		changePlaylist(Number(playlistItemNum));
		$.scrollTo('.video .player', 800);
		return false;
	});
}

function changePlaylist(num) {
		var direction = 'prev';
		var diff = currentPlaylistItem - num;
		if (diff &lt; 0) {
			direction = 'next';
			diff = Math.abs(diff);
		}
		for(i=0; i &lt; diff; i++) {
			player.sendEvent(direction);
		}
		if (currentState == 0) {
			player.sendEvent('play');
		}
}</pre>
<p>There are three requirements to getting started as outlined in the <a href="http://wiki.blip.tv/index.php/Showplayer#Javascript_Interaction">blip.tv wiki</a>:</p>
<ol>
<li>The player must be embeded with the <em>enablejs=true</em> Flash variable set</li>
<li>The player must be embeded with <em>allowScriptAccess=always</em> object/embed parameter set</li>
<li>A JavaScript function must exist named <em>getUpdate()</em></li>
</ol>
<p>The first part of my script sets up three global variables that we&#8217;ll use.</p>
<ul>
<li><em>player</em> will reference the object/embed element by an ID. It is how we send commands to the show player.</li>
<li><em>currentPlaylistItem</em> is the number of the video selected (or position) in the playlist.</li>
<li><em>currentState </em>is either 2 (playing), 1 (loading), or 0 (stopped) depending on the current state of the player.</li>
</ul>
<p>The <em>getUpdate()</em> function listens to the blip.tv player for changes like when the player is stopped or a video is changed in the playlist. The type argument is a string which we can send through a switch statement to determine what we need to do.</p>
<p>If the state of player has changed then we update our <em>currentState</em> variable with the value of arg1 (which will be a number between 0 and 2). If the event is an item change, we will update the currentPlaylistItem variable to reflect that. As an added bonus we get the title of the current playing video and change the title of the webpage to reflect this. This has zero SEO value and is really only a convenience to our audience.  Now that we know what is going on, lets get to the fun stuff.</p>
<p>Three variables (which are really Objects) are created for <a href="http://code.google.com/p/swfobject/">swfobject</a> so we can easily embed the video player dynamically into the page. The &#8216;blip_player&#8217; paramter is the ID of the player that we&#8217;ll be referencing shortly. The <em>swfCallBack()</em> function is called once the blip.tv player has loaded. There we set our <em>player</em> variable to reference the element of the blip.tv player. I used a line of jQuery to set the <em>onClick()</em> events of a group of links that will change the playlist when they are clicked.</p>
<p>In the HTML the links contain direct links to each blip.tv video and an anchor with a number after it. This number is the playlist position of the specific video. jQuery makes it a snap to extract just that number from the URL which we store in the <em>playlistItemNum</em> variable. The <em>playlistItemNum</em> variable is passed along to a function called <em>changePlaylist()</em> which does all of the heavy lifting.</p>
<p>Since the blip.tv show player doesn&#8217;t have a direct way of going to a specific video in a playlist, we have to hit the next or previous button on the player programmatically. The direction is set to &#8216;prev&#8217; initially.  <em>diff</em> is calculated by subtracting the number passed to the function from the position of the currently playing video, <em> currentPlaylistItem</em>.</p>
<p>If <em>diff</em> is a negative number than we need to switch the direction <em>variable</em> to &#8216;next&#8217; and get rid of the negative number by calling the <a href="http://www.w3schools.com/jsref/jsref_abs.asp">absolute value method</a> ( <em>Math.abs()</em> ). Now we simply send the player a command to go to the next or previous video as many times as we need to get to the desired video via a loop. Finally, if the player is stopped, we send the video player a command to start playing the video.</p>
<p>As an added nicety, we gently scroll the viewer up the page to the top of the video player so they&#8217;re not left wondering why nothing happened. The<a href="http://flesler.blogspot.com/2007/10/jqueryscrollto.html"> jQuery scrollTo plugin</a> makes this a breeze to do.</p>
<p>There is one caveat for the <em>changePlaylist()</em> function to work: the playlist needs to be visible on the blip.tv show player. This is simply an option you set on the player configuration screen on blip.tv. Without it showing, we can&#8217;t get which video is playing and the whole thing falls apart.</p>
<p>That wraps up how to roll your own playlist changing function as well as shed some light on how you might control other things about the blip.tv show player using JavaScript. You can see this in action on the <a href="http://pewresearch.org/millennials/video/conference.php">Pew Research Center Millennial Conference video page</a>. If you have any questions leave them in the comments or <a href="http://www.russellheimlich.com/contact.html">get in contact</a>.</p>
<p><a href="http://www.russellheimlich.com/blog/making-javascript-and-the-blip-tv-player-work/">Making JavaScript And The Blip.tv Player Work</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.russellheimlich.com/blog/making-javascript-and-the-blip-tv-player-work/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Dummyimage.com Gets New Features</title>
		<link>http://www.russellheimlich.com/blog/dummyimage-com-gets-new-features/</link>
		<comments>http://www.russellheimlich.com/blog/dummyimage-com-gets-new-features/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 14:21:13 +0000</pubDate>
		<dc:creator>Russell Heimlich</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Dummyimage.com]]></category>
		<category><![CDATA[dummyimage.com]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.russellheimlich.com/blog/?p=2167</guid>
		<description><![CDATA[Ever since the surge of interest in my pet project dummyimage.com I&#8217;ve been meaning to add some new features. Today is the International Day of Awesomeness (which coincides with Chuck Norris&#8217; birthday) and I couldn&#8217;t think of a better time to unveil DummyImage.com&#8216;s new functionality to the public. Here is a run down of the [...]<p><a href="http://www.russellheimlich.com/blog/dummyimage-com-gets-new-features/">Dummyimage.com Gets New Features</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Ever since the <a href="http://www.russellheimlich.com/blog/dummyimage-com-sees-a-surge-in-interest/">surge of interest</a> in my pet project <a href="http://dummyimage.com">dummyimage.com</a> I&#8217;ve been meaning to add some new features. Today is the <a href="http://dayofawesomeness.com/">International Day of Awesomeness</a> (which coincides with <a href="http://www.imdb.com/name/nm0001569/bio">Chuck Norris&#8217; birthday</a>) and I couldn&#8217;t think of a better time to unveil <a href="http://dummyimage.com">DummyImage.com</a>&#8216;s new functionality to the public.</p>
<p><a href="http://dummyimage.com/600x200/0099ff/ff"><img src="http://dummyimage.com/600x200/0099ff/ff" alt="a 600x200 Dummy Image" /></a></p>
<p>Here is a run down of the changes:</p>
<p><a href="http://dummyimage.com/#color"><strong>Specify Custom Colors</strong></a></p>
<p>You can choose the background and foreground colors of the dummy image right in the url using a 6,3,2, or even 1 character hexcode. Don&#8217;t worry if you forget to do this as dummy image will default to gray and black.</p>
<p><a href="http://dummyimage.com/#text"><strong>Add Your Own Text</strong></a></p>
<p>A lot of people wanted to be able to add their own text to a dummy image to better communicate what it is representing. Now using the &amp;text= parameter you can.</p>
<p><strong>A Better Typeface</strong></p>
<p>Arial be damned! Font geeks cringed at my basic choice of a font. Some seemed worried about my distribution of the most popular font on Earth. Now both camps can be happy as I&#8217;m now using the completely free and open <a href="http://mplus-fonts.sourceforge.jp/">M+ Font</a>. I also changed the X in the middle of the images to a multiplication sign × as pointed out by Erinah and Dave Cortright.</p>
<p><a href="http://dummyimage.com/#standards"><strong>Standard Image Sizes</strong></a></p>
<p>Dummyimage.com is a useful prototyping tool and a lot of prototypes and wireframes have ad positions. Instead of memorizing dimensions you can now bring up <a href="http://www.iab.net/iab_products_and_industry_services/1421/1443/1452">ad sizes</a> by their industry-standard name like <a href="http://dummyimage.com/largerectangle">largerectangle</a>, <a href="http://dummyimage.com/skyscraper">skyscraper</a>, and <a href="http://dummyimage.com/fullbanner">fullbanner</a>. You can even customize the colors, text, and formats of theses sizes as well.</p>
<p><a href="http://dummyimage.com/#format"><strong>Pick Your Format</strong></a></p>
<p>Before you could add any image format extension to the url but my script would still generate a GIF image everytime. Now you can generate proper PNG, JPG, and GIF images and drag them into another app trouble free.</p>
<p><a href="http://dummyimage.com/600x250/3/f00/&#038;text=Happy+Birthday+Chuck+Norris"><img src="http://dummyimage.com/600x100/3/f00/&#038;text=Happy+Birthday+Chuck+Norris" alt="Happy Birthday Chuck Norris"></a></p>
<p>And with these new features I figured it was time to give the site a proper, though still simple, design. Rather than bury how these features work in long, boring text I made a little tool that shows you everything you need to know with minimal fuss.</p>
<p>Not a fan of change? Don&#8217;t worry, you can still use Dummyimage.com to generate place holder images exactly the same way you have always been doing it.</p>
<p>So thank you to everyone who has e-mailed me, tweeted me, left a comment on a post somewhere or otherwise provided feedback on dummyimage.com. I&#8217;m glad so many people found it as useful as I think it is. Keep the ideas and <a href="http://dummyimage.com/#other-downloads">dummyimage variations</a> coming. I&#8217;m sure this thing could be better.</p>
<p><a href="http://www.russellheimlich.com/blog/dummyimage-com-gets-new-features/">Dummyimage.com Gets New Features</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.russellheimlich.com/blog/dummyimage-com-gets-new-features/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Put Your Print Stylesheet At The Bottom</title>
		<link>http://www.russellheimlich.com/blog/put-your-print-stylesheet-at-the-bottom/</link>
		<comments>http://www.russellheimlich.com/blog/put-your-print-stylesheet-at-the-bottom/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 03:25:38 +0000</pubDate>
		<dc:creator>Russell Heimlich</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[FAIL]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[print]]></category>
		<category><![CDATA[stylesheet]]></category>

		<guid isPermaLink="false">http://www.russellheimlich.com/blog/?p=2152</guid>
		<description><![CDATA[I woke up this morning with a profound realization. &#8220;Why not put print stylesheets at the bottom of the page so they load last?&#8221;, I thought to myself. It makes perfect sense to any performance-conscious web developer who savors every last millisecond of performance gained. Your print styles aren&#8217;t needed until you print the page, [...]<p><a href="http://www.russellheimlich.com/blog/put-your-print-stylesheet-at-the-bottom/">Put Your Print Stylesheet At The Bottom</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I woke up this morning with a profound realization. &#8220;Why not put print stylesheets at the bottom of the page so they load last?&#8221;, I thought to myself. It makes perfect sense to any performance-conscious web developer who savors every last millisecond of performance gained. Your print styles aren&#8217;t needed until you print the page, so it is okay if it takes a little while longer to download.  Unfortunately the quirkiness of the browser makers trumps our otherwise sound logic.</p>
<p>According to <a href="http://www.stevesouders.com/blog/2010/02/11/mediaprint-stylesheets/">tests done</a> by Steve Souders, web performance guru extraordinaire, Internet Explorer blocks the rendering of content until all of the stylesheets have been downloaded regardless of their media type. And since Internet Explorer is the dominant browser by visitors to most mainstream sites, there is absolutely no benefit to including the print stylesheet at the bottom of the page.</p>
<p>A possible workaround would be to dynamically insert the print stylesheet (using JavaScript) into the web page after it has finished loading. This just feels icky to me as the poor sap who is most likely to print out the webpage I so meticulously coded is also the poor sap using Internet Explorer 5.5 with JavaScript turned off and <a href="http://en.wikipedia.org/wiki/BonziBUDDY">BonziBUDDY</a> turned on.</p>
<p><img class="alignnone size-full wp-image-2153" title="Captain Kirk Facepalm Fail ascii Printout" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/03/captain-kirk-facepalm-fail-ascii.jpg" alt="" width="600" height="892" /></p>
<p><a href="http://www.russellheimlich.com/blog/put-your-print-stylesheet-at-the-bottom/">Put Your Print Stylesheet At The Bottom</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.russellheimlich.com/blog/put-your-print-stylesheet-at-the-bottom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dummyimage.com Sees A Surge In Interest</title>
		<link>http://www.russellheimlich.com/blog/dummyimage-com-sees-a-surge-in-interest/</link>
		<comments>http://www.russellheimlich.com/blog/dummyimage-com-sees-a-surge-in-interest/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 12:52:28 +0000</pubDate>
		<dc:creator>Russell Heimlich</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Dummyimage.com]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[dummy]]></category>
		<category><![CDATA[dummyimage.com]]></category>
		<category><![CDATA[interest]]></category>
		<category><![CDATA[multi-lingual]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[recap]]></category>
		<category><![CDATA[retweet]]></category>
		<category><![CDATA[viral]]></category>

		<guid isPermaLink="false">http://www.russellheimlich.com/blog/?p=2096</guid>
		<description><![CDATA[Way back in August of 2007 I built a simple PHP tool that generates place-holder images at different size by simply changing the URL. The idea came to me when I was working on a redesign for USNews.com. I hated opening up Photoshop, creating a new document,  filling the background layer, and exporting for web [...]<p><a href="http://www.russellheimlich.com/blog/dummyimage-com-sees-a-surge-in-interest/">Dummyimage.com Sees A Surge In Interest</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Way back in August of 2007 I built a simple PHP tool that generates place-holder images at different size by simply changing the URL. The idea came to me when I was working on a redesign for USNews.com. I hated opening up Photoshop, creating a new document,  filling the background layer, and exporting for web just to make a simple placeholder image. That is why I made <a href="http://www.russellheimlich.com/blog/dynamically-create-dummy-images-at-any-size/">dummyimage.com</a>.</p>
<p>I figured it would be useful to other people which is why I also released the complete source code, documented and including instructions for setting it up on your own server. But like most new things, few gave it any notice.</p>
<p><a href="http://twitter.com/charliepark/status/8222003586"><img class="alignnone size-full wp-image-2105" title="The tweet that started it all" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/01/the-tweet-that-started-it-all.png" alt="" width="600" height="379" /></a></p>
<p>The other day my friend Charlie Park (founder of <a href="https://www.pearbudget.com/">Pear Budget</a>) found it when doing some in-browser wire-framing and <a href="http://twitter.com/charliepark/status/8222003586">sent out a tweet</a> to all of his followers. But he didn&#8217;t stop there. Charlie also posted it to <a href="http://news.ycombinator.com/item?id=1077013">Hacker News</a>, a simple news aggregator aimed at geeks. It was obvious that my little tool was resonating with other developers with the tagline &#8220;Lorem ipsom for images.&#8221; In 24 hours, the Hacker News story got 161 votes with 77 comments, <a href="http://delicious.com/url/9884f62d71d7b1377096a40c137a0863">513 people bookmarked it</a> on del.icio.us, and <a href="http://tweetmeme.com/story/28917021/dynamic-dummy-image-generator-dummyimagecom">337 tweets</a>.</p>
<p>What really struck me was how dummyimage.com was crossing the language barrier. I saw tweets mentioning in S<a href="http://twitter.com/alexandergarzon/statuses/8241230231">panish</a>, <span style="color: #551a8b;"><span style="text-decoration: underline;">Japanese</span></span>, <a href="http://twitter.com/paraboom/statuses/8273761981">Russian</a>, <a href="http://twitter.com/apfelsina/statuses/8286247632">German</a>, <a href="http://twitter.com/colorlab/statuses/8274427780">Dutch</a>, even <a href="http://twitter.com/rATRIJS/statuses/8272595627">Latvian</a>. I&#8217;m glad my idea was simple enough that foreign speakers could easily pick it up without any translation help.</p>
<p><a href="http://twitter.com/natsucat/statuses/8262689731"><img class="alignnone size-full wp-image-2101" title="dummyimage.com tweeted in Japanese" src="http://www.russellheimlich.com/blog/wp-content/uploads/2010/01/dummyimage.com-tweeted-in-japanese.png" alt="" width="600" height="342" /></a></p>
<p>All of this sudden attention also produced <a href="http://news.ycombinator.com/item?id=1078801">helpful feedback</a> and <a href="http://news.ycombinator.com/item?id=1078521">new feature ideas</a>. I started working on an update this past December for a few additions I wanted to see but this recent surge of interest has lit a fire under my butt to continue developing. As is the nature of opensource software, people don&#8217;t have to wait for me; they can adapt the code to their own needs. Here are some iterations that have already been made:</p>
<ul>
<li><a href="http://github.com/xxx/fakeimage">Fakeimag</a>e (Ruby)</li>
<li><a href="http://github.com/xxx/placeholder_image">Placeholder_image</a> (Ruby)</li>
<li><a href="http://iamwil.posterous.com/lorem-ipsum-for-images-in-french-maid">Lorem ipsom for Images</a> (JavaScript/jQuery)</li>
</ul>
<p>And somewhere down the line I would like to give it an attractive homepage. Hooray for side projects!</p>
<p><a href="http://www.russellheimlich.com/blog/dummyimage-com-sees-a-surge-in-interest/">Dummyimage.com Sees A Surge In Interest</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.russellheimlich.com/blog/dummyimage-com-sees-a-surge-in-interest/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Paying For JavaScripts? Just View Source</title>
		<link>http://www.russellheimlich.com/blog/paying-for-javascripts-just-view-source/</link>
		<comments>http://www.russellheimlich.com/blog/paying-for-javascripts-just-view-source/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 02:15:46 +0000</pubDate>
		<dc:creator>Russell Heimlich</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Envato]]></category>
		<category><![CDATA[front-end]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[ThemeForest]]></category>

		<guid isPermaLink="false">http://www.russellheimlich.com/blog/?p=1943</guid>
		<description><![CDATA[ThemeForest.net is an online marketplace for developers to sell themes, templates, and other web development related goodies. A lot of the files are for the backend making it next to impossible for someone to copy them without breaking into your server. But ThemeForest offers JavaScripts for sale and even offers a live preview. By the [...]<p><a href="http://www.russellheimlich.com/blog/paying-for-javascripts-just-view-source/">Paying For JavaScripts? Just View Source</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://themeforest.net/?ref=kingkool68">ThemeForest.net</a> is an online marketplace for developers to sell themes, templates, and other web development related goodies. A lot of the files are for the backend making it next to impossible for someone to copy them without breaking into your server. But ThemeForest offers JavaScripts for sale and even offers a live preview.</p>
<p>By the very nature of the web, a front end technology like JavaScript requires the source code to be downloaded to your computer before it can run. This means anyone with a little know-how can easily bypass the need to buy the script and piece it together themselves.</p>
<p>For example, take this <a href="http://themeforest.net/item/jscalendar/67528">JavaScript calendar widget</a> which has 0 sales as of this writing. All you have to do is go to the live preview and remove the frame by clicking the link in the top left corner. From there it&#8217;s just a matter of viewing the source (Choose View-&gt;Source in Internet Explorer, View-&gt;Page Source in Firefox) and copying the necessary JavaScript and CSS files. Here&#8217;s everything you need for this calendar widget:</p>
<ul>
<li><a href="http://s3.envato.com/files/199652/css/calendar.css">http://s3.envato.com/files/199652/css/calendar.css</a></li>
<li><a href="http://s3.envato.com/files/199652/css/setup.css">http://s3.envato.com/files/199652/css/setup.css</a></li>
<li><a href="http://s3.envato.com/files/199652/css/text.css">http://s3.envato.com/files/199652/css/text.css</a></li>
<li><a href="http://s3.envato.com/files/199652/js/resources.js">http://s3.envato.com/files/199652/js/resources.js</a></li>
<li><a href="http://s3.envato.com/files/199652/js/config.js">http://s3.envato.com/files/199652/js/config.js</a></li>
<li><a href="http://s3.envato.com/files/199652/js/calendar.js">http://s3.envato.com/files/199652/js/calendar.js</a></li>
</ul>
<p>Now before you get all upitty about the ethics behind this, you should know that this script is freely available from the <a href="http://www.fogtower.com/products/jscalendar.html" class="broken_link">author&#8217;s own site</a>, which was based on an open source project from around 2006 according to comments in the CSS files.</p>
<p>Granted ThemeForest isn&#8217;t targeted at professional developers like me so someone might be more than happy to plunk down $8 to download everything in one nice, neat package. But if I were selling scripts on ThemeForest, with the expectation of a profit, I would be pissed that ThemeForest didn&#8217;t take more precaution to protect my source code. At the least they could obfuscate the live preview code using a tool like <a href="http://dean.edwards.name/packer/">/packer/</a>.</p>
<p>At any rate this demonstrates why it&#8217;s so hard to sell JavaScripts by themselves due to the very nature of how they work in an open web.</p>
<p><a href="http://www.russellheimlich.com/blog/paying-for-javascripts-just-view-source/">Paying For JavaScripts? Just View Source</a> by <a href="http://www.russellheimlich.com/blog">Russell Heimlich</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.russellheimlich.com/blog/paying-for-javascripts-just-view-source/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced

Served from: www.russellheimlich.com @ 2012-02-04 07:26:27 -->
