<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
  <id>http://roytomeij.com/</id>
  <title>RoyTomeij.com</title>
  <updated>2012-02-16T08:42:13Z</updated>
  <link rel="alternate" href="http://roytomeij.com/" />
  
  <author>
    <name>Roy Tomeij</name>
    <uri>http://roytomeij.com</uri>
  </author>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/roytomeijdotcom" /><feedburner:info uri="roytomeijdotcom" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><entry>
    <id>tag:roytomeij.com,2012-02-16:/2012/rubynation-march-23-24.html</id>
    <title type="html">RubyNation: March 23 &amp; 24</title>
    <published>2012-02-16T08:42:13Z</published>
    <updated>2012-02-16T08:42:13Z</updated>
    <link rel="alternate" href="http://roytomeij.com/2012/rubynation-march-23-24.html" />
    <content type="html">&lt;p&gt;March is going to be a busy month: I'll be speaking at &lt;a href="http://www.rubynation.org/"&gt;RubyNation&lt;/a&gt; (tickets available at the time of writing), which will take place on March 23 &amp;amp; 24 in Reston, VA (USA). It has a great line-up and I'm looking forward to meeting some of our overseas clients. Find a short description of my talk below.&lt;/p&gt;

&lt;h2&gt;Modular &amp;amp; reusable front-end code with HTML5, Sass and CoffeeScript&lt;/h2&gt;

&lt;p&gt;Do you know that feeling when you start a brand new project, telling yourself you're going to keep your front-end clean this time, and end up with an impossible mess after just a few weeks? Find out how to keep things tidy using HTML5 and modular Sass &amp;amp; CoffeeScript, for truly reusable code.&lt;/p&gt;
</content>
    <summary type="html">March is going to be a busy month: I'll be speaking at RubyNation too, which will take place on March 23 &amp; 24 in Reston, VA (USA). My presentation will be about how to create modular and truly reusable front-end code with HTML5, Sass &amp; CoffeeScript, just as in Poland.</summary>
  </entry>
  <entry>
    <id>tag:roytomeij.com,2012-02-10:/2012/sass-doesn-t-create-bad-code-bad-coders-do.html</id>
    <title type="html">Sass doesn’t create bad code. Bad coders do.</title>
    <published>2012-02-10T08:01:53Z</published>
    <updated>2012-02-10T08:01:53Z</updated>
    <link rel="alternate" href="http://roytomeij.com/2012/sass-doesn-t-create-bad-code-bad-coders-do.html" />
    <content type="html">&lt;p&gt;I'm no fan of cross-posting, but I feel so strongly about this one that I just &lt;em&gt;need&lt;/em&gt; to point you to &lt;a href="http://thesassway.com/articles/sass-doesnt-create-bad-code-bad-coders-do"&gt;my article on The Sass Way&lt;/a&gt;, in which I debunk some arguments against using Sass. Sorry if you were expecting the essay here: it's just one click/tap away.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Comments are closed here, feel free to comment at the original source.&lt;/em&gt;&lt;/p&gt;
</content>
    <summary type="html">Those who don’t see any use for pre-processors such as Sass often use the “bad code” argumentation. It creates too specific selectors due to nesting, huge sprites and they hate the way Sass enforces an architectural approach that doesn’t work. And it’s all true. If you’re a poor developer. You know, one who would handcraft too specific selectors, 15MB sprites and doesn’t know how to cleanly structure a project.</summary>
  </entry>
  <entry>
    <id>tag:roytomeij.com,2012-01-30:/2012/wroc-love-rb-march-10-11.html</id>
    <title type="html">Wroc_love.rb: March 10 &amp; 11</title>
    <published>2012-01-30T06:56:56Z</published>
    <updated>2012-01-30T06:56:56Z</updated>
    <link rel="alternate" href="http://roytomeij.com/2012/wroc-love-rb-march-10-11.html" />
    <content type="html">&lt;p&gt;I'm happy to announce that I'll be speaking at &lt;a href="http://www.wrocloverb.com/"&gt;wroc_love.rb&lt;/a&gt;, which will take place on March 10 &amp;amp; 11 in Wrocław, Poland. It's going to be a fun little conference (about 250 attendees if I'm not mistaken) and features a line-up with speakers such as Avdi Grimm and Jim Gay. Find a short description of my talk below.&lt;/p&gt;

&lt;h2&gt;Modular &amp;amp; reusable front-end code with HTML5, Sass and CoffeeScript&lt;/h2&gt;

&lt;p&gt;Do you know that feeling when you start a brand new project, telling yourself you're going to keep your front-end clean this time, and end up with an impossible mess after just a few weeks? Find out how to keep things tidy using HTML5 and modular Sass &amp;amp; CoffeeScript, for truly reusable code.&lt;/p&gt;
</content>
    <summary type="html">I'm happy to announce that I'll be speaking at wroc_love.rb, which will take place on March 10 &amp; 11 in Wrocław, Poland. My presentation will be about how to create modular and truly reusable front-end code with HTML5, Sass &amp; CoffeeScript.</summary>
  </entry>
  <entry>
    <id>tag:roytomeij.com,2012-01-24:/2012/dont-use-class-names-to-find-HTML-elements-with-JS.html</id>
    <title type="html">Don't use class names to find HTML elements with JS</title>
    <published>2012-01-24T16:10:00Z</published>
    <updated>2012-01-24T16:10:00Z</updated>
    <link rel="alternate" href="http://roytomeij.com/2012/dont-use-class-names-to-find-HTML-elements-with-JS.html" />
    <content type="html">&lt;p&gt;In the days before HTML5, when we wanted to bind JavaScript events to an element, we would find the element based on its class name (or the &lt;code&gt;rel&lt;/code&gt; attribute). After all, using a class name won't invalidate your HTML, is easy to target (specially with a library such as jQuery) and provides a hook for styling. But those days are over with the introduction of better suitable techniques, and using class names to find elements leads to confusion and maintenance issues. For true separation of styling and behavior you should use custom data attributes instead, with added benefits.&lt;/p&gt;

&lt;h2&gt;It's not "wrong"&lt;/h2&gt;

&lt;p&gt;In the sense of "not being according the specifications" it isn't wrong (when using HTML5). In the HTML4 specification the W3C is clear on the intended use of the &lt;code&gt;class&lt;/code&gt; attribute, saying it should be used "as a style sheet selector (when an author wishes to assign style information to a set of elements)." The HTML5 specification on the other hand, says: "Assigning classes to an element affects class matching in selectors in CSS, the &lt;code&gt;getElementsByClassName()&lt;/code&gt; method in the DOM, and other such features." So when writing HTML5, you're creating completely valid code.&lt;/p&gt;

&lt;h2&gt;Our example&lt;/h2&gt;

&lt;p&gt;Imagine a situation where you want to apply some interaction to a list of people in various age groups. You have groups of 0 to 9 and 10 to 19 year olds. In your HTML you use &lt;code&gt;class="0-9"&lt;/code&gt; and &lt;code&gt;class="10-19"&lt;/code&gt;. Now you can find all elements belonging to the group of 0 to 9 year olds with &lt;code&gt;$('.0-9')&lt;/code&gt; (jQuery syntax), so you can bind an &lt;code&gt;onclick&lt;/code&gt; event to them. After a while you decide it's fun to style all children with a playful icon, so in your CSS you add a background image for any elements having the &lt;code&gt;.0-9&lt;/code&gt; class (I know that won't work, as it isn't valid CSS, it's just for illustrative purposes). You're doing test driven development, so you make sure to have a test that validates that the JavaScript interaction on the element behaves as intended. Works like a charm!&lt;/p&gt;

&lt;h2&gt;The problem&lt;/h2&gt;

&lt;p&gt;After a while you're replaced or a new developer is added to the team, and the project owner says he would like that little icon we show for small kids to be visible for everyone up to 12 years of ago. Piece of cake for the new guy: just rename the class name &lt;code&gt;0-9&lt;/code&gt; to the more generic &lt;code&gt;kid&lt;/code&gt; in the CSS and make sure the HTML reflects all children up to 12 use this new class name. From all other elements the &lt;code&gt;10-19&lt;/code&gt; class can be removed; it's inaccurate and not used anyway. Your new guy or girl reloads the page and sees it's all good.&lt;/p&gt;

&lt;p&gt;If you're not doing any JavaScript testing, you're already screwed at this point, since there's a fair chance that this change will go into production unnoticed. Looking great, but without the JavaScript events, because there are no elements to find when looking for &lt;code&gt;$('.0-9')&lt;/code&gt;. Sure you could expect your developers to hit every single element after making a trivial change, but that would be too expensive (and you know they won't anyway).&lt;/p&gt;

&lt;p&gt;Bonus points for you if you run tests against your JavaScript; the above should definitely trigger an error. Now you're tasked with fixing your broken code. Changing your JavaScript to use &lt;code&gt;$('.kid')&lt;/code&gt; doesn't work, as it finds more than just children up to 9 years old. Time to add a second class name, reinstating the previous structure. Congratulations: you've spent over an hour on essentially &lt;em&gt;adding&lt;/em&gt; &lt;code&gt;kid&lt;/code&gt; as a second class name to some elements.&lt;/p&gt;

&lt;p&gt;Now imagine that in the starting situation you want to target everyone up to age 12 from your JavaScript. The simple fix is to simply change &lt;code&gt;0-9&lt;/code&gt; to &lt;code&gt;0-12&lt;/code&gt; in both your HTML and JavaScript and you're done. Unless you're doing rigorous manual testing, you won't spot what just broke. There's no automated tool out there that will fail on "show playful background image on all children up to 9 years old", which is what will happen when not changing the class name in your CSS as well.&lt;/p&gt;

&lt;h2&gt;Time to &lt;em&gt;really&lt;/em&gt; start separating structure, styling &amp;amp; behavior&lt;/h2&gt;

&lt;p&gt;You're doing a good job by binding events in your JavaScript instead of using nasty &lt;code&gt;onclick&lt;/code&gt; attributes in your HTML; separation of structure and behavior is important for various reasons. Of course your HTML and CSS need to be linked in some form, as do your HTML and JS. But can targeting elements based on their class name really be considered separation between styling and behavior? You're tying all three layers together, leading to the issues outlined above.&lt;/p&gt;

&lt;h2&gt;Use custom data attributes instead of class names&lt;/h2&gt;

&lt;p&gt;HTML5 brings the joy of being able to use custom data attributes. I suggest using those exclusively to tie HTML and JavaScript together, leaving class names for styling with CSS. It's a simple solution to a common problem and doesn't require more work than the previous approach. We could just use our &lt;code&gt;kid&lt;/code&gt; class name for the background image and add &lt;code&gt;data-age-group="0-12"&lt;/code&gt; (or something more generic) to the elements we want to target in JavaScript. jQuery doesn't have any problems with finding all elements in a certain age group with &lt;code&gt;$('[data-age-group="0-12"]')&lt;/code&gt;, or if you want any element with a certain data attribute regardless of value, &lt;code&gt;$('[data-age-group]')&lt;/code&gt; (this works in IE6 when using jQuery or the &lt;code&gt;getAttribute()&lt;/code&gt; method).&lt;/p&gt;

&lt;h2&gt;Key/value pairs have more semantic meaning&lt;/h2&gt;

&lt;p&gt;You'll gain more semantic meaning when using data attributes. Where "0-9" could mean basically anything, "age-group" is quite clear on what its value is about. It enables you to add a similar metric later, without refactoring. If you want to add the number of pets someone owns you can just add &lt;code&gt;data-pets="0-9"&lt;/code&gt;. When using class names, you would have to refactor your &lt;code&gt;0-9&lt;/code&gt; to something like &lt;code&gt;age-group-0-9&lt;/code&gt; first, change it in your JavaScript and then add &lt;code&gt;pets-0-9&lt;/code&gt; as a second class name.&lt;/p&gt;

&lt;h2&gt;Data attributes enable a modular approach&lt;/h2&gt;

&lt;p&gt;When writing a piece of JavaScript that will be reused throughout various of your projects you want something that just works, regardless of styling. Say you created a "plugin" that takes a regular unordered list and displays all items in the list &lt;em&gt;n&lt;/em&gt; at a time with some fading effects. When not relying on class names for styling you can just drop this in any existing code, for instance by simple adding &lt;code&gt;data-carousel-items="2"&lt;/code&gt; to your &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt;. Your script can find all elements with that attribute and use their values to determine how many items to show at a time, doubling as a config option. It doesn't require any change in the HTML apart from adding that attribute and the CSS can remain untouched.&lt;/p&gt;

&lt;p&gt;Let's make this a best practice.&lt;/p&gt;

&lt;h2&gt;Update: It's slower, and that doesn't bother me&lt;/h2&gt;

&lt;p&gt;As discussed in the comments, looking up elements by data attribute in jQuery is slower than by class name. In &lt;a href="http://jsperf.com/long-selectors-vs-data/2"&gt;this jsPerf test&lt;/a&gt; the &lt;code&gt;$('.class')&lt;/code&gt; operation can be performed ± 124,000 times per second. The &lt;code&gt;$('data-foo="bar"'])&lt;/code&gt; operation only ± 26,000 times (tested on Chrome). Yes, it's over 70% slower. No, it isn't slow. Imagine there are 2,500 elements to search through; it will take under 100 &lt;em&gt;milliseconds&lt;/em&gt;. IE sucks of course, with IE9 handling only just over 7,000 operations/second (sorry for the wait). It works for me.&lt;/p&gt;
</content>
    <summary type="html">Using class names to find elements with JavaScript leads to confusion and maintenance issues. For true separation of styling and behavior you should use custom data attributes instead, with added benefits.</summary>
  </entry>
  <entry>
    <id>tag:roytomeij.com,2011-10-19:/2011/modernizr-the-sass-parent-reference.html</id>
    <title type="html">Modernizr &amp; the Sass parent reference</title>
    <published>2011-10-19T21:30:00Z</published>
    <updated>2011-10-11T16:17:44Z</updated>
    <link rel="alternate" href="http://roytomeij.com/2011/modernizr-the-sass-parent-reference.html" />
    <content type="html">&lt;p&gt;This technique is very simple, but often overlooked because the &lt;a href="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#referencing_parent_selectors_"&gt;parent reference &amp;amp;&lt;/a&gt; is mostly used at the beginning of a selector, like:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sass"&gt;a
  color: #000

  &amp;amp;:hover
    color: #f00&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Since &lt;code&gt;&amp;amp;&lt;/code&gt; does nothing more than repeat the parent selector, it gives us an excellent way of easily implementing custom styling based on features detected by &lt;a href="http://www.modernizr.com/"&gt;Modernizr&lt;/a&gt;. Just have Modernizr add class names to your &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt;-tag and for instance do the following to only apply the box-shadow if the browser supports it (the box-shadow mixin comes with Compass, the &lt;code&gt;.boxshadow&lt;/code&gt; class name will be added to your HTML by Modernizr):&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sass"&gt;#about

  h1
    border: solid 1px #000

    .boxshadow &amp;amp;
      border: 0
      +box-shadow(5px 5px #000)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This outputs:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-css"&gt;&lt;span class="constant"&gt;#about&lt;/span&gt; &lt;span class="type"&gt;h1&lt;/span&gt; {
  &lt;span class="key"&gt;border&lt;/span&gt;: &lt;span class="value"&gt;solid&lt;/span&gt; &lt;span class="float"&gt;1px&lt;/span&gt; &lt;span class="color"&gt;#000&lt;/span&gt;;
}

&lt;span class="class"&gt;.boxshadow&lt;/span&gt; &lt;span class="constant"&gt;#about&lt;/span&gt; &lt;span class="type"&gt;h1&lt;/span&gt; {
  &lt;span class="key"&gt;border&lt;/span&gt;: &lt;span class="float"&gt;0&lt;/span&gt;;
  &lt;span class="key"&gt;box-shadow&lt;/span&gt;: &lt;span class="float"&gt;5px&lt;/span&gt; &lt;span class="float"&gt;5px&lt;/span&gt; &lt;span class="color"&gt;#000&lt;/span&gt;;
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A use case would be a fairly large element with a box-shadow, which makes repainting the page on iOS extremely slow. When only using a box-shadow when there's a &lt;code&gt;.no-touch&lt;/code&gt; class name, touch devices won't have to deal with expensive shadow calculations.&lt;/p&gt;</content>
    <summary type="html">The Sass parent reference (&amp;amp;) makes it even easier to use Modernizr for feature detection, saving you lots of time repeating yourself.</summary>
  </entry>
  <entry>
    <id>tag:roytomeij.com,2011-10-09:/2011/my-arrrrcamp-talk-stop-swashbucklin-and-shipshape-yer-front-end.html</id>
    <title type="html">My ArrrrCamp talk: Stop Swashbucklin' and Shipshape yer Front-end</title>
    <published>2011-10-09T14:23:33Z</published>
    <updated>2011-10-09T14:23:33Z</updated>
    <link rel="alternate" href="http://roytomeij.com/2011/my-arrrrcamp-talk-stop-swashbucklin-and-shipshape-yer-front-end.html" />
    <content type="html">&lt;p&gt;A few days ago I spoke at &lt;a href="http://arrrrcamp.be/"&gt;ArrrrCamp&lt;/a&gt; in Ghent, Belgium. I had heard of the conference before, but never went there during it's prior four years of existence. If those editions were of the same level of quality, I should have. Excellent talks, three tracks, mojito's (no, really) and a proper lunch.&lt;/p&gt;
&lt;p&gt;With the introduction of the Rails 3.1 asset pipeline and Sass &amp;amp; CoffeeScript coming with Rails nowadays, this seemed like a good time to speak about the benefits of using front-end meta languages. I added Haml and Compass to the mix to cover the basics for doing all your markup, styling and behavioral coding using meta languages. Some key elements of the Rails 3.1 asset pipeline were discussed, with a strong focus on the new way of fingerprinting files, not using Sprockets for Sass and what actually happens when precompiling assets.&lt;/p&gt;
&lt;p&gt;This appearance was my debut speaking at a "real" conference. I've done local user groups and meetups in the past (and got some planned for the near future), but hadn't been asked to speak at a conference with paying attendees before. This new experience can pretty much be summarized in one word: "awesome". The organizers took good care of all and I had a blast with both speakers and attendees, specially Jim Gay (lead developer Radiant CMS) and his wife Amy, Brian Quinn (CTO Spree Commerce) and Marius Marnes Mathiesen (Gitorious).&lt;/p&gt;
&lt;p&gt;I'm the first to admit there's room for improvement when it comes to my speaking skills, but after all I'm pretty happy with how it went. Turn-up was fine (I guess half of the attendees attended my talk) and I received positive feedback afterwards. Timing was just right, with enough time for Q&amp;amp;A. While people didn't ask too many questions after some other sessions I attended, there were plenty at mine. Those also gave me a better understanding of the questions back-end developers have when it comes to front-end in general (not linked to front-end meta languages or Rails); food for some blog posts and a new talk I'm going to propose to other conferences (more on that in another post).&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://speakerdeck.com/u/roy/p/front-end-meta-languages-and-the-rails-31-asset-pipeline"&gt;slides are up on Speaker Deck&lt;/a&gt;, which looks a whole lot better than Slideshare, and embedded below.&lt;/p&gt;
&lt;script src="http://speakerdeck.com/embed/4e8f2e597c8b25005400232d.js"&gt;&lt;/script&gt;</content>
    <summary type="html">A few days ago I spoke at ArrrrCamp in Ghent, Belgium. If prior editions were of the same level of quality, I should have gone there before. Here's a short recap, plus my slides.</summary>
  </entry>
  <entry>
    <id>tag:roytomeij.com,2011-06-15:/2011/stop-abusing-the-placeholder-attribute.html</id>
    <title type="html">Stop abusing the placeholder attribute</title>
    <published>2011-06-15T07:09:51Z</published>
    <updated>2011-06-15T07:09:51Z</updated>
    <link rel="alternate" href="http://roytomeij.com/2011/stop-abusing-the-placeholder-attribute.html" />
    <content type="html">&lt;p&gt;The placeholder attribute saves web developers from using JavaScript solutions to tackle a simple task: display a placeholder text in a form input. Right now though, the bulk of all forms using this attribute is doing it wrong. By using this feature in a way that was never intended developers create confusion amongst visitors, sometimes even leading to unusable forms. On top of that it opens the door for data integrity issues.&lt;/p&gt;
&lt;p&gt;According to the &lt;a href="http://dev.w3.org/html5/spec/Overview.html#the-placeholder-attribute"&gt;W3C HTML5 specification on the placeholder attribute&lt;/a&gt; its intended use is clear:&lt;/p&gt;
&lt;blockquote&gt;The placeholder attribute represents a short hint (a word or short phrase) intended to aid the visitor with data entry. A hint could be a sample value or a brief description of the expected format.&lt;/blockquote&gt;
&lt;p&gt;Meaning you can have a text input that has a label in front of it saying "job title", and a placeholder that says "e.g. CEO and philanthropist". It's a great way to indicate what kind of data, being the format or content, you're expecting from a visitor. The W3C also states:&lt;/p&gt;
&lt;blockquote&gt;The placeholder attribute should not be used as an alternative to a label.&lt;/blockquote&gt;
&lt;p&gt;And that's where the majority of developers go wrong. They do just that, crippling the user experience.&lt;/p&gt;
&lt;p&gt;First, there's missing context. Once a visitor focusses on a form input he has to remember what it is again he's supposed to fill in. It could be some secondary phone number, but was it for his cellphone or office phone? The only way to an answer is clicking outside of the input and giving it focus again. In case he already entered some data, he will need to remove that first.&lt;/p&gt;
&lt;p&gt;Then there's validation. After submitting the form something may be wrong. The visitor is often shown an input with a red border and the generic "please check your input", or something more specific along the lines of "please enter your phone number without dashes or spaces" (which is a retarded error, you should fix that for the visitor on the server side anyway). Should we really expect a visitor to copy his input to the clipboard, lose focus, read what he was supposed to enter, focus on the input, paste his original text back in and fix any mistakes?&lt;/p&gt;
&lt;p&gt;Last but not least there's the problem of data integrity. For instance, when a form starts with two inputs, for first and last name, a visitor may enter his last name first (in some countries it's customary to enter your last name first). When done filling out the form he glances over it, making sure it looks fine. After submitting there's no error, so apparently we're all good. Now the database has a first name for last name and the other way around.&lt;/p&gt;
&lt;p&gt;Bottom line: always provide a label that goes with an input. Yes, you will have to take that into account in your design. Yes, it will make your form take up more space. Yes, it will make it way easier for a user to submit a form. As an added bonus this also works on older, non-HTML5 capable browsers. A form should be perfectly usable without placeholders.&lt;/p&gt;</content>
    <summary type="html">The placeholder attribute saves web developers from using JavaScript solutions to tackle a simple task: display a placeholder text in a form input. Right now though, the bulk of all forms using this attribute is doing it wrong.</summary>
  </entry>
  <entry>
    <id>tag:roytomeij.com,2011-05-27:/2011/static-site-using-nanoc.html</id>
    <title type="html">Static site using nanoc</title>
    <published>2011-05-27T08:25:46Z</published>
    <updated>2011-05-27T08:25:46Z</updated>
    <link rel="alternate" href="http://roytomeij.com/2011/static-site-using-nanoc.html" />
    <content type="html">&lt;p&gt;This site now runs on &lt;a href="http://nanoc.stoneship.org/"&gt;nanoc&lt;/a&gt;, a static site generator running on Ruby. The old Wordpress install went out the window and I only migrated two posts; the ones that people are likely to land on via search engines. I chose a static site because that's what all the cool kids have. Besides that I was pretty much done with showing my latest tweet, etc. Just go to &lt;a href="http://www.teitter.com/roy"&gt;Twitter&lt;/a&gt; if you want to know. A static site also saves me from any possible security issues (it's all just HTML) and updates to Wordpress and its plugins. Best of all: I can just write my posts in &lt;a href="http://haml-lang.com/"&gt;Haml&lt;/a&gt; now. Deployment is done by running an rsync task in Rake.&lt;/p&gt;
&lt;p&gt;For syntax highlighting I use the &lt;a href="http://coderay.rubychan.de/"&gt;CodeRay&lt;/a&gt; gem, based on instruction in &lt;a href="http://austinbirch.co.uk/2011/02/17/syntax_highlighting_in_nanoc.html"&gt;this post&lt;/a&gt; and some Googling. This site is open source, so if you want you may just clone it at &lt;a href="https://github.com/roytomeij/roytomeij.com"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As for actual blogging: we'll see how that goes...&lt;/p&gt;</content>
    <summary type="html">This site now runs on nanoc, a static site generator running on Ruby. The old Wordpress install went out the window and I only migrated two posts.</summary>
  </entry>
  <entry>
    <id>tag:roytomeij.com,2009-11-19:/2009/the-perfect-home-theater-setup-with-automated-downloads.html</id>
    <title type="html">The perfect home theater setup with automated downloads</title>
    <published>2009-11-18T23:00:00Z</published>
    <updated>2009-11-18T23:00:00Z</updated>
    <link rel="alternate" href="http://roytomeij.com/2009/the-perfect-home-theater-setup-with-automated-downloads.html" />
    <content type="html">&lt;p&gt;
&lt;em&gt;Warning: this post is very much outdated. I will write a new one with more awesomeness soon.&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;A friend of mine asked me to write about my (near perfect) home theater setup, including the automated downloading of new episodes of TV series. This post is a first attempt, and I will probably revise it numerous times in the future.&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Please note that downloading (not distributing) TV series for personal use is legal in my jurisdiction.&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;My setup involves an HD-Ready TV (720p), Mac Mini, Harman/Kardon 5.1 receiver, SABnzbd+, Eweka, XBMC, MyTvNZB, TheTvDB &amp;amp; more. I will go over it in the following chapters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;hardware &amp;amp; connection&lt;/li&gt;
&lt;li&gt;automated downloading&lt;/li&gt;
&lt;li&gt;organizing &amp;amp; watching&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;I assume you already know about usenet, NZB files, etc. If not, start googling.&lt;/p&gt;
&lt;h2&gt;Hardware &amp;amp; connection&lt;/h2&gt;
&lt;p&gt;For an excellent image, I have a Sony Bravia HD-Ready TV (720p) connected to a Mac Mini (2007 model; Core 2 Duo, 1.82GHz, 1GB RAM) with a DVI-to-HDMI cable. For audio I have a 5.1 speaker setup, connected to a Harman/Kardon AVR 247 receiver. The Mac Mini is connected to the receiver using the optical out.&lt;/p&gt;
&lt;p&gt;The Mac Mini is connected to a 20mbit ADSL connection, although I end up with roughly 17mbit. I connected the Mini with an actual cable, since the internal wifi antenna is kind of crappy. Luckily I already had UTP cabling running through my walls.&lt;/p&gt;
&lt;p&gt;To store all TV series I have two 1TB and one 1.5TB Western Digital Elements hard disks connected to the Mini (yes, that's a grand total of 3.5TB). I recently changed the 80GB hard disk in the Mini to a 320GB model, so I can use that one as a temporary storage for downloads. That way the external disks can go to sleep while I'm still downloading, since the internal hard disk will often spin anyway. SABnzbd+ (see below) unpacks the stuff directly to one of the external drives. When a drive is almost full, I tell it to unpack to a new one.&lt;/p&gt;
&lt;p&gt;This basically is all there is to say about my hardware. You only need to remember to connect both the video &amp;amp; audio digitally, and don't use the wifi if you want some proper speed.&lt;/p&gt;
&lt;h2&gt;Automated downloading&lt;/h2&gt;
&lt;p&gt;This is where the fun starts! When I get up in the morning, yesterdays TV series (the ones I wanted to download) are waiting for me. Downloaded, unpacked, repaired if damaged, moved to the correct location and with downloaded episode information &amp;amp; artwork. Lets start with the setup for downloading.&lt;/p&gt;
&lt;p&gt;Since the Mac Mini sits near the TV anyway, idling all day (&amp;amp; most of the night too), this is the machine I use for downloading. I download all my stuff from usenet, by connecting to a paid usenet provider. You want proper retention (the time stuff is available on the server), and &lt;a href="http://www.eweka.nl/"&gt;Eweka&lt;/a&gt; (the one I use) provides over 250 days of it for EUR 7,50 per month. Great deal!&lt;/p&gt;
&lt;p&gt;To actually download the stuff I use &lt;a href="http://www.sabnzbd.org/"&gt;SABnzbd+&lt;/a&gt;, which can download, extract, repair, rename &amp;amp; move your stuff. It uses NZB files as a way of knowing what to download. On one of my external disks I have a "download" directory and a "series" directory. Configure SABnzbd+ so it knows it should download to "download", and move it to "series" after it finishes. Make sure to enable the "TV sorting" feature on the "Config &amp;gt; Folders" tab, so your downloads get organized properly. I use this filepath/filename structure: &lt;code&gt;%sn/Season %s/%sn - S%0sE%0e - %en.%ext&lt;/code&gt;. This way your series end up something like this: "Burn Notice/Season 1/Burn Notice - S01E01.mkv" (it doesn't always clean up filenames as nicely as this, but that usually doesn't matter).&lt;/p&gt;
&lt;p&gt;Now we have set up the automated downloading and sorting, we have to let SABnzbd+ know what it should download and where to get it. For this I use the RSS feature, to be configured on the "Config &amp;gt; RSS" tab, in combination with &lt;a href="http://www.tvnzbrss.com/"&gt;MyTvNZB&lt;/a&gt;. Go there, select "only show x264 or better" and check all the series you want to dowload. After saving it will prompt you with the url for the RSS feed to use in SABnzbd+. Add it there, and make sure you set the category to "tv".&lt;/p&gt;
&lt;p&gt;That's it for the automated downloading! You now have your mean &amp;amp; lean downloading machine setup so it automatically downloads new episodes of your favorite series in HD. You might want to cap the download speed of SABnzbd+ at something around 2mbit below your max, so you still have enough bandwidth for regular ol' web browsing.&lt;/p&gt;
&lt;h2&gt;Organizing &amp;amp; watching&lt;/h2&gt;
&lt;p&gt;To keep track of what TV series I have, which episodes are unwatched, read episode summaries and of course actually watch them I use &lt;a href="http://xbmc.org/"&gt;XBMC&lt;/a&gt;. Set it up (lots of guides for that, and pretty straight forward too) and tell it that the "content type" of your "series" directory is "TV shows" (get the context menu by right clicking, or holding the "menu" button on your remote until it pops up). You can do this for multiple directories on multiple hard disks, and they will all show up in one combined library. Enable "library mode" and hit "update library". It will now use the excellent &lt;a href="http://thetvdb.com/"&gt;TheTvDB&lt;/a&gt; webservice to find general information, plot summaries and artwork for your series. If some series don't show up, go to TheTvDB and look it up there; the name probably is slightly different than your directory name. Turn of library mode temporarily, right click the directory and select "change name". Change it to how TheTvDB spelled it, hit "done" and turn library mode back on. After updating your library it will show up.&lt;/p&gt;
&lt;p&gt;I have "hide watched items" turned on, so I only see stuff that needs watching. Matter of personal preference. If you want to control your XBMC with a remote, there's a free iPhone app for that in the app store! Of course you can also use the regular Apple Remote, or an all-in-one (I can highly recommend the &lt;a href="http://www.logitech.com/index.cfm/remotes/universal_remotes/"&gt;Logitech Harmony&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;I hope this post is helpful in setting up your perfect system. If not, or you need more details, leave a comment!&lt;/p&gt;
&lt;p&gt;update: Updated my setup (new hard disks) and added some info on XBMC.&lt;/p&gt;</content>
    <summary type="html">A friend of mine asked me to write about my (near perfect) home theater setup, including the automated downloading of new episodes of TV series.</summary>
  </entry>
  <entry>
    <id>tag:roytomeij.com,2009-09-15:/2009/vodafone-mobile-connect-on-osx-10-6-snow-leopard-with-an-e3730-data-card.html</id>
    <title type="html">Vodafone Mobile Connect On Osx 10.6 (Snow Leopard) With An E3730 Data Card</title>
    <published>2009-09-14T22:00:00Z</published>
    <updated>2009-09-14T22:00:00Z</updated>
    <link rel="alternate" href="http://roytomeij.com/2009/vodafone-mobile-connect-on-osx-10-6-snow-leopard-with-an-e3730-data-card.html" />
    <content type="html">&lt;p&gt;After trying numerous "solutions", I finally managed to get my Vodafone "express data card" (the E3730 by Option) to work on OSX 10.6 (Snow Leopard), together with Vodafone's "Mobile Connect" software.&lt;/p&gt;
&lt;p&gt;I don't know if this works with all versions of Mobile Connect, but at least it did with this one: &lt;a href="http://www.vodafone.nl/Vodafone/software/supportanddownload/VodafoneMCInstaller.2.11.04.00.dmg.zip" target="_blank"&gt;Vodafone Mobile Connect 2.11.04.00&lt;/a&gt;. After installing the Mobile Connect software (if you don't have it yet), the trick is to "update" the drivers for the data card to the OSX 10.4 (Tiger) version. For this you need to &lt;a href="/wp-content/uploads/option_e3730_snow_leopard.zip" target="_blank"&gt;download the Option drivers&lt;/a&gt; (Option forgot to add some extensions, so this goes to the proper zip I made after fixing them).&lt;/p&gt;
&lt;p&gt;Simply open the dmg, install the 10.4 drivers and you're done (or at least: I was).&lt;/p&gt;
&lt;p&gt;PS: &lt;em&gt;NO&lt;/em&gt; thanks to the Vodafone help desk, which doesn't know sh*t and has been keeping me and numerous others in the blind since Snow Leopard was released. Spend a few $ on the developer release next time guys!&lt;/p&gt;</content>
    <summary type="html">After trying numerous "solutions", I finally managed to get my Vodafone "express data card" (the E3730 by Option) to work on OSX 10.6 (Snow Leopard).</summary>
  </entry>
</feed>

