<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Brian Egan</title> <link>http://brianegan.com</link> <description>Designer and Developer</description> <lastBuildDate>Thu, 07 Oct 2010 07:10:31 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.1.3</generator> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/BrianEgan" /><feedburner:info uri="brianegan" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Overhauling WordPress Performance</title><link>http://feedproxy.google.com/~r/BrianEgan/~3/MPhwvKGvz5E/</link> <comments>http://brianegan.com/overhauling-wordpress-performance/#comments</comments> <pubDate>Thu, 07 Oct 2010 07:06:06 +0000</pubDate> <dc:creator>Brian</dc:creator> <category><![CDATA[Performance]]></category> <category><![CDATA[Theming]]></category> <category><![CDATA[Wordpress]]></category><guid isPermaLink="false">http://brianegan.com/?p=249</guid> <description><![CDATA[After launching my new site last week, I&#8217;ve wanted to take some time to step back and look at front and back-end performance. As some wise twitter sage recently said, &#8220;Simple + Measurable = Successful.&#8221; I couldn&#8217;t agree more. Simple Tools So we need simple tools to speed up our site. Luckily, WordPress is blessed [...]]]></description> <content:encoded><![CDATA[<p>After launching my new site last week, I&#8217;ve wanted to take some time to step back and look at front and back-end performance. As some wise twitter sage recently said, &#8220;Simple + Measurable = Successful.&#8221; I couldn&#8217;t agree more.<br
/> <span
id="more-249"></span></p><h2>Simple Tools</h2><p>So we need simple tools to speed up our site. Luckily, WordPress is blessed with the <a
href="http://wordpress.org/extend/plugins/w3-total-cache/">W3 Total Cache plugin</a>. This one plugin handles everything from caching to minifying JavaScript and CSS to setting e-tags and proper expiration headers. Basically, it handles all the necessary front-end and back-end performance tweaks in one place!</p><h2>Initial Measurements</h2><p>We also need a way to measure our progress. For testing, I&#8217;ll use Apache Bench on the back-end and Yahoo! YSlow and Google Page Speed on the front-end.</p><h3>Apache Bench</h3><p>So lets take a look at the Apache Bench results from an uncached page, without any JavaScript minification (CSS minification is in place for this test).</p><p><img
src="http://brianegan.com/wp-content/uploads/2010/10/Screen-shot-2010-10-06-at-11.36.29-PM.png" alt="Screenshot of Apache Bench - Initial Results" title="Screenshot of Apache Bench - Initial Results" width="546" height="231" class="alignnone size-full wp-image-251" /></p><h3>Page Speed</h3><p>Now let&#8217;s take a look at our results from YSlow and Page Speed.</p><p><img
src="http://brianegan.com/wp-content/uploads/2010/10/Screen-shot-2010-10-06-at-11.39.11-PM.png" alt="Google Page Speed - Initial Results" title="Google Page Speed - Initial Results" width="416" height="223" class="alignnone size-full wp-image-252" /></p><h3>YSlow</h3><p> <img
src="http://brianegan.com/wp-content/uploads/2010/10/Screen-shot-2010-10-06-at-11.39.34-PM.png" alt="Yahoo! YSlow - Initial Results" title="Yahoo! YSlow - Initial Results" width="282" height="263" class="alignnone size-full wp-image-253" /></p><h3>Discussion of Initial Results</h3><p>Wow, 77.663 seconds to serve 1000 requests, for a whopping 12.88 requests per second. Now, I&#8217;m not getting flooded with traffic. But if I ever did, lets just say that wouldn&#8217;t work. The site needs some serious tweaking on the back-end.</p><p>With regard to the front-end, Yahoo! thinks I&#8217;m pretty swell and deserve an A, while Google thinks I&#8217;m a C student. So there&#8217;s a bit of work to do here as well. My biggest target is reducing HTTP requests from multiple JavaScript and image files.</p><h2>The Fix</h2><p>W3 Total Cache is truly amazing. All you have to do is enable the plugin, check on the types of caching you&#8217;d like to do, and it handles almost all the usually annoying stuff for you. It caches pages onto the hard disk or memcached. It can concatenate and compress JavaScript and load it in a blocking or non-blocking manner. It can set all the proper headers and etags for ya. It does all the database and object caching.</p><p>The only part which requires some careful configuration (as I learned tonight) is the JavaScript minification. I thought I nailed the correct settings, deployed said settings, and found I had broken my site! So, take a bit of care when playing with the JavaScript minification, and it&#8217;s probably best not to operate on your site live as I was doing!</p><p>That&#8217;s it. Sure, I did a bit of work on my CSS files, simplifying them and concatenating + compressing them. But overall, I let W3 Total Cache do all the heavy lifting. So, what are the results!?</p><h2>Final Results</h2><p>Once again, we&#8217;ll look at Apache Bench, YSlow, and Page Speed.</p><h3>Apache Bench</h3><p> <img
src="http://brianegan.com/wp-content/uploads/2010/10/Screen-shot-2010-10-06-at-11.35.24-PM.png" alt="Apache Bench - Final Results" title="Apache Bench - Final Results" width="548" height="237" class="alignnone size-full wp-image-254" /></p><h3>Page Speed</h3><p> <img
src="http://brianegan.com/wp-content/uploads/2010/10/Screen-shot-2010-10-06-at-11.40.28-PM.png" alt="Page Speed - Final Results" title="Page Speed - Final Results" width="369" height="207" class="alignnone size-full wp-image-255" /></p><h3>YSlow</h3><p> <img
src="http://brianegan.com/wp-content/uploads/2010/10/Screen-shot-2010-10-06-at-11.40.07-PM.png" alt="YSlow - Final Results" title="YSlow - Final Results" width="283" height="244" class="alignnone size-full wp-image-256" /></p><h2>Conclusion</h2><p>So, with one simple plugin, and a bit of CSS work, I&#8217;ve gotten amazing results. On the backend, it took only a quarter of a second to deliver 1000 requests. That&#8217;s 300x faster than our initial run! Requests per second went through the roof as well, from 12ish to around 3800. Unreal. The plugin certainly did it&#8217;s job on terms of backend performance.</p><p>In terms of front-end, not too shabby. Really, my CSS was already mostly minified and concatenated, so the only gain I really got was taking 11 HTTP requests for JavaScript down to 1! That boosted my Google Score to a solid B, and Yahoo gave me a bit of love as well, bumping my A up by 4 points.</p><p>The last thing I need to do is run SpriteMe! on my page to reduce the number of background images being requested. That, and going cookieless for static content, and my site will be about as good as I can get it on a shared hosting service!</p> <img src="http://feeds.feedburner.com/~r/BrianEgan/~4/MPhwvKGvz5E" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://brianegan.com/overhauling-wordpress-performance/feed/</wfw:commentRss> <slash:comments>4</slash:comments> <feedburner:origLink>http://brianegan.com/overhauling-wordpress-performance/</feedburner:origLink></item> <item><title>Why I’m a CSS-preprocessor Fanboy</title><link>http://feedproxy.google.com/~r/BrianEgan/~3/_Ppsy9R-40k/</link> <comments>http://brianegan.com/why-im-a-css-preprocessor-fanboy/#comments</comments> <pubDate>Thu, 09 Sep 2010 23:03:05 +0000</pubDate> <dc:creator>Brian</dc:creator> <category><![CDATA[CSS]]></category><guid isPermaLink="false">http://brianegan.com/?p=117</guid> <description><![CDATA[I got a great question in my comments section about how Scaffold, a CSS-preprocessor, helps me keep my HTML free of non-semantic grid classes. This seems like a good time to discuss generally why, despite my initial skepticism, I&#8217;ve become a big fan of CSS-preprocessors, such as SASS, LESS, and Scaffold. So what exactly is [...]]]></description> <content:encoded><![CDATA[<p>I got a great question in my comments section about how Scaffold, a CSS-preprocessor, helps me keep my HTML free of non-semantic grid classes. This seems like a good time to discuss generally why, despite my initial skepticism, I&#8217;ve become a big fan of CSS-preprocessors, such as <a
href="http://sass-lang.com/">SASS</a>, <a
href="http://github.com/cloudhead/less.js">LESS</a>, and <a
href="http://github.com/anthonyshort/scaffold">Scaffold</a>.</p><p><span
id="more-117"></span></p><h2>So what exactly is a CSS-preprocessor?</h2><p>Despite having somewhat of a weird name, CSS-preprocessors are fairly simple to understand. You, as a front-end dev, write code that looks pretty much like CSS, with some extra goodies that make your code shorter and easier to read. Then, you run it through a CSS-preprocessor, and it transforms, or preprocesses, your &#8220;pretty much&#8221; CSS into real, bonafied CSS that runs in all your favorite browsers, like Internet Explorer 5 for Mac.</p><p>Perhaps the best way to explain what CSS-preprocessors do is through a short code demonstration, taken from the SASS website.</p><pre name="code" class="CSS">/* SASS Code */
table.hl {
  margin: 2em 0;

  td.ln {
    text-align: right;
  }
}

li {
  font: {
    family: serif;
    weight: bold;
    size: 1.2em;
  }
}</pre><p>Then, you run it through SASS, and get the following CSS:</p><pre name="code" class="CSS">/* CSS  Output */
table.hl {
  margin: 2em 0;
}
table.hl td.ln {
  text-align: right;
}

li {
  font-family: serif;
  font-weight: bold;
  font-size: 1.2em;
}
</pre><p>As you can see, instead of having to spell out long selectors over and over yourself, you can simply nest selectors. SASS, LESS, and Scaffold all behave the same way in this case, and can detect your nesting. Then, they spell out the long selector names for you, as shown above. I find this feature alone makes my CSS more readable and quicker to develop.</p><p>In addition, CSS-preprocessors offer other helpful features like mixins, variables, and importing. What&#8217;s best is when you combine all of these features together, you can not only make your styles easier to read, but also create a better separation between style and content, making your site easier to maintain. This is perhaps my favorite feature of CSS-preprocessors.</p><h2>How CSS-preprocessors help the separation of style and content</h2><p>With 960, you link to the grid stylesheet and then place classes such as &#8220;grid_4&#8243;  throughout your HTML. In my opinion, these classes are presentational, not semantic, and are therefore best left within your CSS to maximize your separation of style from content.</p><h3>960 Style</h3><p>To create a site with 12 columns using 960.gs, featuring a main content area and sidebar (similar to the setup of most blogs), the code would look something like this:</p><pre name="code" class="HTML">&lt;div id="content" class="grid_8"&gt;CONTENT HERE&lt;/div&gt;
&lt;div id="sidebar" class="grid_4"&gt;SIDEBAR HERE&lt;/div&gt;
&lt;link href="960.gs" /&gt;
</pre><h3>Scaffold Style</h3><p><strong>HTML</strong></p><pre name="code" class="HTML">&lt;div id="content"&gt;CONTENT HERE&lt;/div&gt;
&lt;div id="sidebar"&gt;SIDEBAR HERE&lt;/div&gt;
&lt;link href="styles.css" /&gt;
&lt;-- Yay no grid classes! --&gt;
</pre><p><strong>styles.css &#8211; Scaffold Code</strong></p><pre name="code" class="CSS">@grid
{
  grid-width: 960;
  right-gutter-width: 10;
  left-gutter-width: 10;
  column-count: 12;
  baseline: 18;
}
#content {
  +columns(8);
}
#sidebar {
  +columns(4);
}
</pre><p><strong>Scaffold Output (what would be seen by your browser)</strong></p><pre name="code" class="CSS">#content {
  width: 600px;
  margin: 0 10px;
  float: left;
}
#sidebar {
  width: 300px;
  margin: 0 10px;
  float: left;
}
</pre><p>As you can see from the Scaffold Code, you declare a grid and then Scaffold generates a series of &#8220;mixins&#8221; you can use throughout your CSS, such as &#8220;+columns(8);&#8221; or &#8220;+push(4);&#8221;. SASS and LESS have ways of emulating this functionality as well. They take those mixins, and turn them into good ol&#8217; CSS. This means you can keep your HTML free of those crazy grid classes, and from my experience, it makes maintaining your grid much easier in the long run.</p><h2>The watch feature</h2><p>One standout feature I also have to mention is the &#8220;watch&#8221; feature. While this is available for SASS and Scaffold, I feel the newest version of LESS, written in JavaScript, has the best implementation. What does it do? For this one, I think a demonstration is in order:</p><p><object
classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0' width='560' height='345'><param
name='movie' value='http://screenr.com/Content/assets/screenr_1116090935.swf' /><param
name='flashvars' value='i=105077' /><param
name='allowFullScreen' value='true' /><embed
src='http://screenr.com/Content/assets/screenr_1116090935.swf' flashvars='i=105077' allowFullScreen='true' width='560' height='345' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed></object></p><p>One thing I forgot to mention in the screencast, and why I prefer the LESS.js watch feature to almost any other solution: It works in all browsers. With two monitors, I can hack away in my editor, and make sure that my CSS is working in Chrome, Firefox, and IE on the fly. Truly amazing. And you can learn more about LESS.js by reading the following article: <a
href="http://fadeyev.net/2010/06/19/lessjs-will-obsolete-css/">Less.js Will Obsolete CSS</a></p><h2>Drawbacks of CSS-preprocessors</h2><p>Now, while I love me some CSS-proprocessors, they do have some drawbacks. First of all, while they save time, they also take a bit of time to learn and get comfortable with. This is a tradeoff I think is well worth it in the long run, but other reasonable people may disagree.</p><p>Second, while I really like a lot of things about Scaffold, I&#8217;ve felt it is very clunky in some ways. For example, it won&#8217;t render your CSS at all if you&#8217;re simply missing an image referenced within your Scaffold CSS. You can adjust the error level to correct this, but it&#8217;s not an ideal solution. Scaffold is currently undergoing a full rewrite, which will hopefully give it a smoother experience in general.</p><p>Third, I think CSS-preprocessors can encourage over-nesting, which causes styles to be a bit too specific and therefore not as reusable. Although refactoring is a part of any coding exercise, I think premature nesting is something to be watched out for with CSS-preprocessors because they just make it so darn easy to do.</p><p>Finally, I think the overall code size may be something to examine. While being able to use the grid mixins may result in less code if you&#8217;re only using them a couple or few times, if you need to use a ton of grid mixins, I worry code may actually bloat. This hasn&#8217;t been as big an issue for me, but it&#8217;s something to consider.</p><h2>Final words</h2><p>I recommend keeping an open mind and looking at what each has to offer, then deciding for yourself what to choose. Since I&#8217;m an opinionated loudmouth, I&#8217;ll just tell you my current favorite is LESS.js because I&#8217;m a JavaScript junkie. But I love SASS syntax, and the grid system in Scaffold is awesome. They all have their strengths and weaknesses, so play around with em a bit! You&#8217;ll love em too.</p> <img src="http://feeds.feedburner.com/~r/BrianEgan/~4/_Ppsy9R-40k" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://brianegan.com/why-im-a-css-preprocessor-fanboy/feed/</wfw:commentRss> <slash:comments>5</slash:comments> <feedburner:origLink>http://brianegan.com/why-im-a-css-preprocessor-fanboy/</feedburner:origLink></item> <item><title>Fight Recap: NodeKO</title><link>http://feedproxy.google.com/~r/BrianEgan/~3/tUWJ7Yv2Ij4/</link> <comments>http://brianegan.com/fight-recap-nodeko/#comments</comments> <pubDate>Fri, 03 Sep 2010 07:28:21 +0000</pubDate> <dc:creator>Brian</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[NodeJS]]></category><guid isPermaLink="false">http://brianegan.com/?p=106</guid> <description><![CDATA[This past weekend I had the honor of participating in the fearsome Rocky-IV-style hackathon that was Node Knockout. For those who may actually have a life: Node Knockout was a 48 hour competition featuring teams of hackers each pecking away at a web application that should be somewhat complete-ish after at the end of the two days. In [...]]]></description> <content:encoded><![CDATA[<p>This past weekend I had the honor of participating in the fearsome Rocky-IV-style hackathon that was <a
href="http://nodeknockout.com/">Node Knockout</a>. For those who may actually have a life: Node Knockout was a 48 hour competition featuring teams of hackers each pecking away at a web application that should be somewhat complete-ish after at the end of the two days. In our case, we tried to build a fairly full-feature music player in 2 days (<a
href="http://vegasjs.no.de/">yeah lets see how that turned out</a>)&#8230;</p><p><span
id="more-106"></span></p><p>Ok, so if you followed the previous link and checked out our app, you&#8217;ll see that it&#8217;s somewhat pretty (for a ripoff), and barely functional! Man we rock&#8230; but really, the competition wasn&#8217;t just about winning for our team as much as it was about fiddling around with some new JavaScript hawtsawce. So here&#8217;s what I learned:</p><h2>Pick your 48 hour project Wisely</h2><p>Yeah, so our <em>idea </em>was to actually build a NodeJS backend which could scan the directories input by the user, read the id3 tag info from the files within those directories (as a start, we could support ogg and flac and other format metadata schemes later), and then put the metadata into a CouchDB.</p><p>Then the client could connect to your server, grab the catalog from NodeJS, and play songs that NodeJS would convert on the fly into the proper format for your browser depending on capability (probably through a child process exec to some other encoder &#8212; haven&#8217;t figured that part out yet).</p><p>Unfortunately, we hit a snag on step 1 of this process: reading the data from an id3 tag, which is binary data stored at the beginning on an mp3 file. Node can read streams of data, like so:</p><pre name="code" class="javascript">  var s = fs.createReadStream(file, {start: 1, end: 2});

  s.on('data', function(data){
    console.log(data.toString());
  });</pre><p>This is actually the code I was using to check whether a particular file begins with &#8220;ID3,&#8221; which would thus signify ID3 version 2 data. All the fun technical details behind ID3 can be read about here: <a
href="http://www.id3.org/Developer_Information">http://www.id3.org/Developer_Information</a></p><p>But this is about when things started to break down. After this, and I&#8217;m literally talking about the first 10 bytes here, became totally beyond my grasp for a 48 hour competition. WTF does this mean, for example:</p><blockquote><p> The ID3v2 tag size is stored as a 32 bit synchsafe integer (section<br
/> 6.2), making a total of 28 effective bits (representing up to 256MB).</p></blockquote><p>I mean, I somewhat get what that&#8217;s saying. If you just read section 6.2, you can clear as day see&#8230;</p><p>All this led me to one conclusion after a few hours: <strong>Choose your project wisely</strong>. Dylan Bathurst, who I&#8217;m officially dubbing my &#8220;Node Wingman,&#8221; is a Front end guy. I&#8217;m a front end guy. We probably should not have picked a project that not only required us to pick up server-side programming, but also get all Computer Science major trying to decipher binary data (I have a degree in Sociology &#8212; super helpful for that kind of thing). It seems like a simple game using WebSockets might have been a better call&#8230; but oh well, just pick a project that helps you learn Node and plays to your strengths!</p><h2>Plan a bit in advance&#8230;</h2><p>We did a bit of preliminary planning, but we really didn&#8217;t get into the nitty gritty of our roles and responsibilities until the competition began. Not that this isn&#8217;t a totally fun way to approach a 48 hour competition, and if you think Animal from the Muppets is the coolest guy ever, then just jumping headfirst into the competition might be the best thing for you.</p><p>But, it seemed like some of the <a
href="http://www.startupmonkeys.com/2010/09/building-a-scrabble-mmo-in-48-hours/">best ideas</a> had been well thought out a in advance, including splitting up roles for each team member so they could focus on their tasks. With only 2 days of actual design and programming time, getting the prep out of the way so you can focus on code is clutch.</p><h2>The community rocks</h2><p>Yeah, I&#8217;m talking to you. I hadn&#8217;t spent much time in IRC before that weekend, but I was able to ask questions and get prompt, helpful responses. Plugin creators took their time to explain basic stuff to me, and it was even easy to hit up the creator of NodeJS. Plus, the vibe was just electric. Man, it was just fun being in there with everyone.</p><p>I also gotta say that I was really impressed with the <a
href="http://joyent.com">Joyent</a> setup overall. Thanks for providing such an awesome platform on which to host the competition!</p><h2>Even if you don&#8217;t know anything about NodeJS, you should still totally participate</h2><p>I wasn&#8217;t completely ignorant of Node, but I&#8217;m by no means an expert, and I haven&#8217;t built any serious/real apps on it. Heck, I hadn&#8217;t even built much of a toy app with it. This was my first real attempt at anything of substance. And even though we didn&#8217;t get a fully-functional app going, I learned more in two days than I have in a long time.</p><p>I would encourage anyone who has even the smallest inclination to give Node a shot to join this competition next time it comes around. If you haven&#8217;t learned Node because you don&#8217;t really know what to do with it, this competition ends that excuse! Just dive in. The water is warm &#8212; I promise!</p><h2>The future is lookin pretty good&#8230;</h2><p>And you know what was so cool about this competition? Knowledge wasn&#8217;t the best thing I gained. I walked away with a sense of optimism I haven&#8217;t felt in a while. When you get into the daily grind, a lot of the knowledge we accumulate seems to be incremental rather than revolutionary. NodeJS is a revolution.</p><p>Now, of course, there are a couple of secrets I&#8217;ve gotta save for myself until next year to give myself a bit of a competitive edge (heyo!), but I gotta end this post thanking everyone who put the competition together, Joyent again for hosting, the awesome people who were hangin out in IRC, and my buddy Dylan for putting the app together with me! It was a blast, and you&#8217;d better believe we&#8217;re gonna win it next year, so be ready to bring it!</p> <img src="http://feeds.feedburner.com/~r/BrianEgan/~4/tUWJ7Yv2Ij4" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://brianegan.com/fight-recap-nodeko/feed/</wfw:commentRss> <slash:comments>2</slash:comments> <feedburner:origLink>http://brianegan.com/fight-recap-nodeko/</feedburner:origLink></item> <item><title>Drupal Theming: Zen vs Tao</title><link>http://feedproxy.google.com/~r/BrianEgan/~3/tC0BK90JNtI/</link> <comments>http://brianegan.com/drupal-theming-zen-vs-tao/#comments</comments> <pubDate>Thu, 15 Apr 2010 15:01:16 +0000</pubDate> <dc:creator>Brian</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Drupal]]></category> <category><![CDATA[Theming]]></category><guid isPermaLink="false">http://brianegan.com/?p=53</guid> <description><![CDATA[If you, like me, are working on your first Drupal theme, a big question can be: Do I really need a base theme or should I start from scratch? This is an easy question to answer: start with a base theme. Why? Because even if you start from scratch, you really aren&#8217;t starting from scratch. [...]]]></description> <content:encoded><![CDATA[<p>If you, like me, are working on your first Drupal theme, a big question can be: Do I really need a base theme or should I start from scratch? This is an easy question to answer: start with a base theme. Why? Because even if you start from scratch, you really aren&#8217;t starting from scratch. Drupal loads in a bunch of CSS files for you. And the styles they apply make far too many assumptions. And as my 9th grade Geometry teacher loved to say: assumptions make an &#8220;ass&#8221; out of &#8220;u&#8221; and &#8220;me.&#8221;</p><p>So if you&#8217;re going to go with a base theme, which to chose? There are a ton out there, but the two I was most intrigued by were Zen and Tao, and I&#8217;m going to tell you why Tao totally beat the heck outa Zen in a very Buddhist way.<br
/> <span
id="more-53"></span></p><h2>Zen &#8211; the path to (record scratch)</h2><p>I started with Zen. It was very nice at first. It made me feel welcome in a foreign land. It has nice documentation. It walked me step-by-step through creating a sub-theme. I felt good. I felt confident.</p><p>After my sub-theme was established, I checked it into our SVN repository, and began coding. This was going well! I saw a lot of things I liked about Zen &#8212; A focus on accessibility, an attempt to break down CSS into logical files so you don&#8217;t have one monster CSS file, logical content regions, and did I mention the documentation!?</p><h3>Heart of Darkness</h3><p>But after a few days of working with Zen, theming became maddening. What had been sensible defaults now turned into a Heart of Darkness journey to find and override styles. I was spending far more time in Firebug tracking down exactly what styles were doing so they could be overridden instead of coding my site. And I couldn&#8217;t use <a
href="http://drupal.org/project/scaffold">CSScaffold</a>, which is my CSS framework of choice, due to the way the comments were formatted throughout (this really isn&#8217;t Zen&#8217;s fault).</p><p>And while the CSS files were broken down, they are broken down in a very illogical way which requires redefining selectors in multiple files, and also mixing your screen and print styles. For example, zen has &#8220;layout.css&#8221; where you&#8217;re supposed to put all layout-related styles, such as display, margin, padding, floating, etc. But then it encourages you to put background and font styles in other stylesheets &#8212; yuck! That decision alone makes it very hard to quickly visualize what an element will look like in your &#8220;Minds Compiler&#8221;, and requires you to shift between files just to make edits to a single element. Overall, bad news.</p><h3>Not so sure about ems</h3><p>Furthermore, within Zen, fonts and many margins are sized in ems. I decided to go with the flow and keep using ems, which is nice if you want to support text resizing in IE6, but is a complete mess if you&#8217;re trying to establish a baseline grid. Ems turn into nasty fractions you have to constantly calculate (and recalculate if you want to do something simple like make the page text slightly larger), and the rounding errors that occur cross browser are simply unavoidable. So scratch that. IE6 only accounts for 1.5% of our users, and my brain accounts for 100% of my sanity.</p><h3>No reset &#8212; the deal breaker</h3><p>And then, in my opinion, the dagger in the heart: There&#8217;s just no reset. This was an intentional design decision by the creators, but in my opinion, a HUGE mistake. I simply could not get my Zen sub-theme to render consistently in all browsers, which is a direct result of no reset.</p><p>So I added a reset. But you know what? It was still inconsistent! Ack, why? Because of Drupal&#8217;s core CSS files. It was like a <a
href="http://www.poemhunter.com/poem/a-dream-within-a-dream/">dream within a dream</a>&#8230; I just couldn&#8217;t escape Firebug purgatory, and almost lost my cool with Drupal. Once again, I had found myself in assumption land, and I didn&#8217;t like it.</p><h2>Tao rescues me. Or did I rescue myself?</h2><p>So I went back to the drawing board. I went through a lot of the starter themes again, and still saw a bunch of stuff I was concerned about. This time around, I wanted a theme which did one thing well &#8212; reset pretty much everything so that my Drupal page looks just like an XHTML document with a reset CSS applied to it. No weird spacing, no more Drupal CSS files effing with me, and I didn&#8217;t want ANY STYLING. I literally didn&#8217;t even want default columns, tabs, yellow backgrounds for blocks on the edit-block page, NOTHING. I just wanted some very clean HTML with a reset style that made everything consistent between all our favorite browsers.</p><p>And that&#8217;s when I remembered reading about Rubik theme from Development Seed. If you don&#8217;t know, Development Seed makes the best looking Drupal sites. The Best. No question in my mind about it.</p><p><a
href="http://code.developmentseed.org/rubik/">Rubik </a>is a fantastic administration theme. It dramatically improves the drupal administrative interface by reducing visual clutter, and it looks just wonderful. It&#8217;s worth it to download and install just for it&#8217;s own functionality. And best of all: it relies on a fantastic base theme maintained by Development Seed: <a
href="http://code.developmentseed.org/tao/">Tao</a>.</p><p>As Tao says: &#8220;Tao is a base theme for Drupal that is all about going with the flow. It is not meant for general-purpose use, but instead takes care of several tasks so that sub-themes can get on with their job.&#8221; And this is exactly what it does.</p><p>It has an &#8220;aggressive reset,&#8221; provides preprocessing functions for &#8220;core annoyances,&#8221; properly splits up its files between screen and print, and unifies theme files within a &#8220;templates&#8221; directory (thank you for this alone &#8212; makes the directory structure much cleaner!).</p><p>Basically, it resets the ugly in Drupal, and kindly opens the door to beautiful design for you.</p><p>Now, I can use CSScaffold. This gives my page a beautiful grid without needing to further pollute my HTML with even more extraneous classes, as you have to do to employ 960gs or Blueprint.</p><p>I can split CSS files up into an order I think is much more logical (CSS files for the header, footer, content, blocks, etc). This means no more switching between files to edit one selector, and also prevents me from slipping into Firebug Purgatory.</p><p>And best of all &#8212; my site renders almost perfectly across browsers now.</p><h2>Conclusion</h2><p>If you&#8217;re just starting off, Install Zen and play with it. If you&#8217;re a casual designer and don&#8217;t care too much about whether the line-height of your fonts is off, and don&#8217;t particularly care about rigid control of you grid system (which is too bad, cus your page probably looks ugly), go ahead and use Zen.</p><p>But if you want to avoid Firebug Purgatory, clean up your code, organize it in a way that&#8217;s logical to you, and make sites that are truly spectacularrrrr, the choice is clear: use Tao.</p><p>And if you don&#8217;t believe me, take a look at <a
href="http://www.lullabot.com/">Lullabot</a> (creators of Zen), and then compare it to <a
href="http://developmentseed.org">Development Seed</a>. Lullabot&#8217;s site isn&#8217;t bad &#8212; I&#8217;m not saying that, but it clearly isn&#8217;t the same caliber as Development Seed. And if that&#8217;s the case, which one do you trust to make the best base theme? I know where I&#8217;m putting my money.</p> <img src="http://feeds.feedburner.com/~r/BrianEgan/~4/tC0BK90JNtI" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://brianegan.com/drupal-theming-zen-vs-tao/feed/</wfw:commentRss> <slash:comments>40</slash:comments> <feedburner:origLink>http://brianegan.com/drupal-theming-zen-vs-tao/</feedburner:origLink></item> <item><title>Book Review: Advanced JavaScript by TJ Holowaychuck</title><link>http://feedproxy.google.com/~r/BrianEgan/~3/rpOP0NEpA-c/</link> <comments>http://brianegan.com/book-review-advanced-javascript-by-vision-media/#comments</comments> <pubDate>Mon, 29 Mar 2010 02:41:57 +0000</pubDate> <dc:creator>Brian</dc:creator> <category><![CDATA[JavaScript]]></category><guid isPermaLink="false">http://brianegan.com/?p=44</guid> <description><![CDATA[I&#8217;m not sure if it&#8217;s been done before, but I may very well be the first GitHub stalker (hold your applause, please). Who is my target you ask? Vision Media, aka TJ Holowaychuk on GitHub, author of ExpressJS, a Sinatra-inspired Web Framework written for NodeJS. After cloning and examining a lot of his repos (Use [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m not sure if it&#8217;s been done before, but I may very well be the first GitHub stalker (hold your applause, please). Who is my target you ask? <a
href="http://github.com/visionmedia">Vision Media</a>, aka TJ Holowaychuk on GitHub, author of <a
href="http://expressjs.com/">ExpressJS</a>, a Sinatra-inspired Web Framework written for NodeJS.</p><p>After cloning and examining a lot of his repos (Use the Source!), I found out in an endnote that TJ had published a book entitled <a
href="http://www.dev-mag.com/2010/02/18/advanced-javascript/">Advanced JavaScript</a> from <a
href="http://www.dev-mag.com/">DevMag</a>. It&#8217;s a short book, but one that opened my eyes in a surprising number of ways.<br
/> <span
id="more-44"></span></p><h2>Overview</h2><p>The books Table of Contents are as follows:</p><ul><li>Ch 1: Closures, Scope and Context</li><li>Ch 2: Prototypal Inheritance</li><li>Ch 3: Advanced Meta-programming techniques</li><li>Ch 4: Behavior Driven Development</li><li>Ch 5: Creating a jQuery Clone</li><li>Ch 6: Tools of the trade</li></ul><p>The meat of this review will focus on Chapters 3-5, which made me rethink the way I develop JavaScript. No offense to the author(s), but the contents in Chapters 1 and 2 have been better explained in other texts, notably <a
href="http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1269827039&amp;sr=8-1">JavaScript: The Good Parts</a> by Douglas Crockford, and Chapter 6 should have probably just been an Appendix.</p><p>But back to the good stuff: Chapter 3 goes through the creation of a JavaScript clone of some of the most basic functionality found in Sinatra, namely creating routes and executing them when matched. While the concept of DRY is often promoted as The Thing To Do, this chapter clearly explained some of the ways to make your programs smarter so that you can in fact avoid repetition! Very nice.</p><h2>The revolution will not be televised, it will be tracked on GitHub</h2><p>The revolution started for me in Chapter 4. I&#8217;d read about some agile programming techniques, but I&#8217;d never heard of BDD, or Behavior Driven Development. Chapter 4 talks about how to implement BDD with JavaScript using JSpec, an awesome unit testing framework, and one that totally changed how I think about my projects.</p><h3>An aside on BDD</h3><p>Essentially, BDD is an &#8220;outside-in&#8221; methodology, meaning that you start by identifying outcomes with your clients (internal or external), and then map out the features that will achieve such outcomes. This often happens in a story format.</p><p>Overall, it&#8217;s fantastic because it allows your clients to stay on the same page as you, the developer. You define concrete outcomes with your clients, and which steps needed to be taken for each feature to work. This means that both you and your clients have a solid understand of what needs to be done, and what &#8220;done&#8221; truly means. To read more about BDD specifically, check out <a
href="http://blog.dannorth.net/whats-in-a-story/">a great explanation of BDD</a> from the inventor, Dan North.</p><h3>Using JSpec to implement BDD</h3><p>With regard to chapter 4, JSpec helps us implement BDD from the developers perspective. Once the outcomes and features have been hashed out into specific steps, or &#8220;units,&#8221; then the developer can begin doing his/her job! Now, BDD is an extension of test driven development, and therefore implies that we should begin not by writing our implementation, but by writing Unit Tests to ensure that the functionality defined within our story is properly executed! By working this way, developers get the myriad of benefits that come from proper unit testing, such as avoiding regressions (breaking your code).</p><p>However, it had never really clicked in my mind how to really do convenient / good unit testing with JavaScript, and that&#8217;s what Chapters 4 and 5 go into in detail. There are a ton of libraries out there, but none of them encourage Unit Testing as part of the workflow the way JSpec does, because most of them are just simple unit testing frameworks written in JavaScript. But JSpec is so much more!</p><p>Jspec doesn&#8217;t just include a unit testing JavaScript file, you download a whole Ruby gem and get amazing command-line utilities for creating new projects with testing and documentation all set up, and then very convenient methods for running the unit tests in all your browsers! For example, if you execute the following command:</p><p><code>jspec init mySpecTest</code></p><p>You&#8217;ll get a new folder called mySpecTest with a directory full of goodies, such as a convenient folder structure for creating consistent projects, and all you need to run the JSpec unit tests. With the specs from your client in hand, you could then quickly begin writing your unit tests to achieve the desired functionality! Then all you have to do is write your JavaScript to pass all of your tests, and you have a very discrete piece of functionality &#8220;done!&#8221;</p><h2>Wrap Up</h2><p>The book does a great job of going through how to use JSpec in a number of ways, and how to build a cool, limited jQuery clone using the principles of BDD. Overall, as I said, this has literally changed the way I think about writing JavaScript in the future. This will certainly be the approach I take (I had never really written rigorous tests for my JS before), but one that I can immediately see will provide a ton of benefits to the quality of my code.</p><p>If you&#8217;re like me, and you thought &#8220;Unit testing is pretty cool, but I really have no idea how to properly implement it,&#8221; you will walk away from this book knowing exactly how to use unit tests, and you&#8217;ll also probably be bursting with ideas about how you can improve your code and your development methodologies.</p><p>&#8220;Advanced JavaScript&#8221; rules, and for $4 it is well worth the price. <a
href="http://www.dev-mag.com/2010/02/18/advanced-javascript/">Go buy it</a>.</p><h2>Addendum/Nitpicks</h2><p>Now, while the book totally kicks ass, I did have some minor problems with it. I really think the book needs a good editor. There are some frankly just kind of sloppy grammatical and spelling errors throughout the book, and the writing in general could use a good solid critique to make it a bit better. Also, there&#8217;s a lot of source code presented in the book, but the book didn&#8217;t come with all of the source in separate files. It had a few files, but it was missing some of the JSpec files that I would have found most interesting.</p> <img src="http://feeds.feedburner.com/~r/BrianEgan/~4/rpOP0NEpA-c" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://brianegan.com/book-review-advanced-javascript-by-vision-media/feed/</wfw:commentRss> <slash:comments>2</slash:comments> <feedburner:origLink>http://brianegan.com/book-review-advanced-javascript-by-vision-media/</feedburner:origLink></item> <item><title>I heart Node.js</title><link>http://feedproxy.google.com/~r/BrianEgan/~3/VVskzBoAAXQ/</link> <comments>http://brianegan.com/i-heart-node-js/#comments</comments> <pubDate>Wed, 10 Mar 2010 06:20:04 +0000</pubDate> <dc:creator>Brian</dc:creator> <category><![CDATA[JavaScript]]></category><guid isPermaLink="false">http://brianegan.com/?p=35</guid> <description><![CDATA[Node.js is one of the most intriguing projects I&#8217;ve seen in a while. For some reason, I&#8217;ve never truly enjoyed programming until I started programming in JavaScript. I did the usual BASIC programming as a freshman in high school, and actually tried learning C a bit earlier when I was 12 (let&#8217;s just say it [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://nodejs.org">Node.js</a> is one of the most intriguing projects I&#8217;ve seen in a while. For some reason, I&#8217;ve never truly enjoyed programming until I started programming in JavaScript. I did the usual BASIC programming as a freshman in high school, and actually tried learning C a bit earlier when I was 12 (let&#8217;s just say it didn&#8217;t go over well, except that I did win a C &#8220;competition&#8221; in high school based on that knowledge).</p><p>But when I could start hooking up my designs to really cool functionality, such as <a
href="http://code.google.com/p/dmmonocle">dmMonocle</a>, my jQuery plugin for viewing images, I loved the combination that was possible. I could not only make beautiful designs, I could make beautiful web applications. My code could react to the actions of users &#8212; or in JavaScript lingo, the events of users.<br
/> <span
id="more-35"></span></p><h2>Server side JS?</h2><p>I&#8217;ve since learned to branch out, and have an affection for Python as well at this point! But I&#8217;m still in that weird designer/front end dev gray area, so I don&#8217;t get as much Python time as I&#8217;d like. However, with the advent of Node.js, I can now do some pretty awesome server side stuff in my favorite language. That&#8217;s right, you heard me: JavaScript is going server side &#8212; and even further in the future! Here&#8217;s the code I wrote to implement a <em>very</em> simple web server with Node.JS:</p><pre name="code" class="javascript">
var fs = require('fs'),
    sys = require('sys'),
    http = require('http');

// Simple Server Function
// Pulls the url of the request and responds with the appropriate HMTL file
// If no HTML file found in the request url, returns a 404 error. Boosh!

http.createServer(function (req, res) {

    var HTML;

    if(req.url.search(/\.html$/) > -1) { // Searches to see if the URL entered by the user ends in .html
        fs.readFile('../' + req.url, encoding='utf8', function(err, data) { // If it does, it tries to read the file
            if (err) { // Oh noes! The file doesn't exist! 404-butter time!
                _404(err);
            } else {
                HTML = data;
                res.writeHead(200, {'Content-Type': 'text/html'});
                res.write(HTML);
                res.close();
            }
        });
    } else { // Hey, they didn't enter a valid URL! You know what that means -- 404 BUTTER TIME!
       _404();
    }

    function _404(err) {
        if (err) sys.log(err);
        fs.readFile('../404.html', encoding='utf8', function(err, data) {
           HTML = data;
           res.writeHead(200, {'Content-Type': 'text/html'});
           res.write(HTML);
           res.close();
        });
    }

}).listen(8080); // Listen on port 8080
sys.puts("Brian's HTML Server running at http://127.0.0.1:8080/"); // Output a string to STDOUT (the command line in most cases)
</pre><h2>Lame, but WTF is require()?</h2><p>Now, this server isn&#8217;t very durable. For example, the html files have to be one directory down from the node server &#8212; not awesome, and it serves no CSS. But it was just a simple test script I wrote in 5 minutes to see what could be done with Node, and was a heck of a lot of fun. It also introduced me to the <a
href="http://commonjs.org/">CommonJS</a> project, and their implementation of modules. First of all, the CommonJS project aims to produce a common spec for server-side and application-building JavaScript  &#8212; i.e. JavaScript&#8217;s not just for browsers anymore!</p><p>Now on to modules: at the top of the code, you&#8217;ll see I&#8217;m declaring 3 variables, all of which call a <code>require()</code> function. That require function is an example of the CommonJS module implementation, a way for JavaScript to pull in the contents from another file in a similar fashion to Python&#8217;s <code>import</code> or Ruby&#8217;s <code>require</code>.</p><h2>The way of the future?</h2><p>Pretty cool stuff for a few minutes of compilation time, reading through the <a
href="http://nodejs.org/api.html">Node.JS API</a> (which only takes about 45 minutes even if you&#8217;re slow like me), and then getting a little dirty &#8212; and by that, I mean not dirty at all.</p><p>There&#8217;s some real potential here, and I&#8217;m going to take some time to play around with <a
href="http://github.com/visionmedia/express">Express</a>. It&#8217;s a Node.JS web framework inspired by a Sinatra, a Ruby web framework. Sinatra is another intriguing piece of software, and combined with HAML and SASS, two great technologies for rapidly developing HTML and CSS, it&#8217;s a very nice package indeed. Express seems to have adopted those parts of Sinatra, and should be just a grand old time to tinker with.</p> <img src="http://feeds.feedburner.com/~r/BrianEgan/~4/VVskzBoAAXQ" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://brianegan.com/i-heart-node-js/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://brianegan.com/i-heart-node-js/</feedburner:origLink></item> <item><title>jQuery DOM Manipulation und Performance</title><link>http://feedproxy.google.com/~r/BrianEgan/~3/0Fx6iyRjUdU/</link> <comments>http://brianegan.com/jquery-dom-manipulation-und-performance/#comments</comments> <pubDate>Wed, 10 Feb 2010 08:00:18 +0000</pubDate> <dc:creator>Brian</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Performance]]></category><guid isPermaLink="false">http://brianegan.com/?p=19</guid> <description><![CDATA[I&#8217;m not promising this blog is gonna be hot and spicy all the time, but It&#8217;s been a while since I posted, and I thought I would make it something geeky &#8212; performance tests! I swear I&#8217;m working on a new template for this site, and naturally it&#8217;s going to revolutionize web design. Unfortunately, skiing [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m not promising this blog is gonna be hot and spicy all the time, but It&#8217;s been a while since I posted, and I thought I would make it something geeky &mdash; performance tests! I swear I&#8217;m working on a new template for this site, and naturally it&#8217;s going to revolutionize web design. Unfortunately, skiing and learning to play the Ukulele keeps eating up all my time! But I digress&#8230;</p><p><span
id="more-19"></span></p><h2>Flame war! (Intro)</h2><p>I was actually a sociology major in college, so I kind of enjoy the rigor of trying to test things well. This is not a rigorous test &mdash; but I did learn some fun stuff!</p><p>Over at NETTUTS there was <a
href="http://net.tutsplus.com/tutorials/javascript-ajax/24-best-practices-for-ajax-implementations/">a discussion about the best way to update the DOM using jQuery</a>. The author suggested this method, and was promptly called an idiot:</p><pre name="code" class="javascript">
var updatedText = "<span id="\&quot;elem1\&quot;">Value1</span>
<span id="\&quot;elem2\&quot;">Value2</span>";
$("#container").html(updatedText);
</pre><p>I actually used a variation on this method when writing <a
href="http://code.google.com/p/dmmonocle">dmMonocle</a>, my jQuery plugin which makes viewing images within library digital collections, such as the <a
href="http://digital.library.unlv.edu/http://digital.library.unlv.edu/boomtown/dm.php/snv/1173">Southern Nevada Boomtowns Collection</a>, a bit easier. What dmMonocle does is generate a series of tiles (<code>divs</code>) and then injects them all together at once, just as the author suggested above. Others claimed that the built-in jQuery methods (<code>.html()</code> &amp; <code>.append()</code>) were more readable, and should therefore be used.</p><h2>Test me once, shame on you (Methods)</h2><p>In these cases, I like to let the numbers speak for themselves, and so I created a series of tests using JSFiddle that test the performance of three methods. I posted a couple of <a
href="http://jsfiddle.net/cMHzS/1/">simple tests</a> to NETTUTS this morning, but I thought it would be fun to get more in-depth and play around with loops of console profiles and timers to test performance (you know, how every sane person likes to spend their time)!</p><p>I wanted to time and profile three different functions:</p><ul><li>Build a string of spans and inject it once into a container using the <code>.html()</code> method</li><li>Update each one of the spans individually with <code>$(#span).html("new html")</code></li><li>Building the spans within the contain using the <code>.appendTo()</code> method.</li></ul><p>As the bad joke of a subheading should tell you, we don&#8217;t simply want to run these timers and profiles once, we want to run them 100 times (more would probably be better). To run them once would be a grave mistake. Don&#8217;t you remember doing 10 trial runs in science class to eliminate error? Did you think the cheeky lab report workflow of this post was a mistake?</p><p>I&#8217;m also running these tests on a Summer 2009 Macbook Pro, and would love to hear about results from other machines.</p><h2>Show me the code! (Data)</h2><ul><li><a
href="http://jsfiddle.net/cMHzS/9/">Timer Tests</a></li><li><a
href="http://jsfiddle.net/cMHzS/10/">Profile Tests</a></li></ul><p>As I said, these tests run each method 100 times. Scratch that, Firefox ate it when I tried that =P I&#8217;ll just run em a bunch manually and record numbers the good ol&#8217; fashioned way. I&#8217;ll work on best practices for averaging results in a future post</p><h3>Chrome</h3><p>My new browser of choice:</p><ol><li>First Test Average: 2-3ms</li><li>Second Test Average: 6-8ms</li><li>Third Test Average: 8-10ms</li></ol><h3>Firefox 3.6</h3><p>Tried and true (but slooooooow):</p><ol><li>First Test Average: 11-12ms</li><li>Second Test Average: 21-23ms</li><li>Third Test Average: 37-39ms</li></ol><p>I mean look at that. 3-5x slower than Chrome 4 on simple operations.</p><h3>Safari</h3><p>Safari was&#8230; creepy with how consistent it was. I think I may be doing something wrong</p><ol><li>First Test Average: 3ms</li><li>Second Test Average: 6ms</li><li>Third Test Average: 16ms</li></ol><h3>Internet Explorer</h3><p>I can only run IE on a virtual machine at the moment, and I&#8217;m not sure how reliable that is. Give me some data!</p><h2>Blah Blah Blah, what&#8217;s the bottom line (Results und Discussion)</h2><p>Bottom line is that, according to my tests, using native JavaScript strings to build the html and injecting it once is roughly twice as fast as the updating method, and 3-5x times faster than append method (which is the most similar to the original string function). These results are due to the fact that the string method skips over calling not only the jQuery constructor <code>$()</code> on each iteration, but also the jQuery methods <code>.html()</code> and <code>.append()</code>, which themselves call multiple functions (as demonstrated by the profiling tests).</p><p>Based on those facts, when I need to inject any significant amount of code, I&#8217;m going to try to do as much building as I can in regular old JavaScript, avoiding the DOM and unnecessary jQuery methods as much as possible. Look, jQuery is great and really fast; I mean, I&#8217;m literally talking about 2-5x slower than 2 <em>mili</em>seconds). But, I&#8217;ll basically take any speed advantage I can get, and in this instance there is a clear winner. I personally don&#8217;t think the JavaScript is too much uglier or less maintainable than the jQuery fashion, but that is really a matter of taste. When it comes to the data, there&#8217;s no debate.</p> <img src="http://feeds.feedburner.com/~r/BrianEgan/~4/0Fx6iyRjUdU" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://brianegan.com/jquery-dom-manipulation-und-performance/feed/</wfw:commentRss> <slash:comments>3</slash:comments> <feedburner:origLink>http://brianegan.com/jquery-dom-manipulation-und-performance/</feedburner:origLink></item> <item><title>WordPress Polar Bear Club – Part 1</title><link>http://feedproxy.google.com/~r/BrianEgan/~3/zDSUgZ5WqxY/</link> <comments>http://brianegan.com/wordpress-polar-bear-club-part-1/#comments</comments> <pubDate>Wed, 27 Jan 2010 18:59:17 +0000</pubDate> <dc:creator>Brian</dc:creator> <category><![CDATA[Theming]]></category> <category><![CDATA[Wordpress]]></category><guid isPermaLink="false">http://brianegan.com/?p=14</guid> <description><![CDATA[I&#8217;d like to welcome you all to my first series of blog posts, where I&#8217;ll detail the steps I&#8217;m taking to customize my WordPress theme and plugins, turning this bland old default theme into a well designed site. I&#8217;ve never worked with WordPress, had a dusty old portfolio, and decided it was time to jump [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;d like to welcome you all to my first series of blog posts, where I&#8217;ll detail the steps I&#8217;m taking to customize my WordPress theme and plugins, turning this bland old default theme into a well designed site. I&#8217;ve never worked with WordPress, had a dusty old portfolio, and decided it was time to jump right in to the icy cold water. In this first part I&#8217;d like to talk about what I&#8217;m doing as I get ready to theme this site!<br
/> <span
id="more-14"></span></p><h2>Starting with SEO</h2><p>I usually don&#8217;t start with SEO, but I have a few friends who run a blog called <a
href="http://scrappymarketing.com">Scrappy Marketing</a>, and they put up a great post entitled <a
href="http://scrappymarketing.com/2009/01/seo-101-for-your-wordpress-site-in-7-easy-steps/">SEO 101 for your WordPress site – In 7 easy steps</a>. Because I had never even installed a plugin before, going through this tutorial was a great introduction to some of the UI features, such as easy plugin installation,  configuring said plugins through the &#8220;Settings&#8221; menu, getting setup with Akismet, etc. Essentially, they have you:</p><ol><li>Activate Akismet, the spam blocker for WordPress. Done and done.</li><li>Download and configure &#8220;All in one SEO&#8221; for better meta information and title tags</li><li>Get Feedburner rockin for better stats about my readership</li><li>Download Evermore, which adds the &#8220;more&#8221; tags automatically. (I actually skipped this step)</li><li>Download and Install Social Bookmarking Reloaded. I did, but I&#8217;ll probably look at other options or figure out how to customize this one a little more to my liking.</li><li>Install XML-Sitemap, making it easier for teh robotz to evaluate your worth</li><li>Setup a permalink structure. Clutch.</li></ol><p>What a great way to begin. I got to work with WordPress a bit, and also configured some important things up front, such as my meta data, permalink structure, and Feeburner. Not a bad way to spend 30 minutes!</p><h2>Local Dev Environment</h2><p>After instlalling those plugins on the server, I realized that I was probably going to need a local dev environment to do my theming. No worries there: I just grabbed the free version of <a
href="http://www.mamp.info/en/index.html">MAMP</a> (Windows users can grab <a
href="http://www.apachefriends.org/en/xampp.html">xampp</a>, Linux users &#8212; you know what to do =P). I also use a program called <a
href="http://www.navicat.com/download/download.html">Navicat Light</a>, which is basically a desktop version of phpMyAdmin, to create databases and users.</p><p>After firing up MAMP, using Navicat Light to get my database ready, and installing WordPress locally, I was ready to move onto playing with some themes!</p><h2>So&#8230; how does this work?</h2><p>I&#8217;ve worked with PHP and Django themes enough to know the basics of how to pull the content I need, but I thought it would make sense to start by looking at other porfolio themes to see how the structured their theme folder, categorize content, and pull it through with specialized templates. While I thought about buying a professional theme, I found some good free ones from the following links:</p><ul><li><a
href="http://www.wpzoom.com/design/wordpress-as-a-portfolio-examples-themes-15/">Using WordPress as a Portfolio: Examples &amp; Themes</a></li><li><a
href="http://www.smashingmagazine.com/2008/01/08/100-excellent-free-high-quality-wordpress-themes/">100 Excellend Free WordPress Themes</a></li><li><a
href="http://www.smashingmagazine.com/2007/02/09/83-beautiful-wordpress-themes-you-probably-havent-seen/">83 Beautiful WordPress Themes</a></li></ul><p>After installing 10 or so from those sites, I feel like I have a pretty good idea of how I&#8217;ll proceed from here. In my next post, I&#8217;ll discuss what I&#8217;m doing in the background, from my initial brain dump, to sketching compositions, to my first photoshop mockups. Stay tuned!</p> <img src="http://feeds.feedburner.com/~r/BrianEgan/~4/zDSUgZ5WqxY" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://brianegan.com/wordpress-polar-bear-club-part-1/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://brianegan.com/wordpress-polar-bear-club-part-1/</feedburner:origLink></item> </channel> </rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching using disk
Object Caching 481/569 objects using disk

Served from: brianegan.com @ 2012-02-01 05:31:48 -->

