Going The Wong Way I'm ALWAYS going the Wong way

Octopress For Static Blogging

Thank you, Wordpress. You were fantastic to me for over 5 years, but I’m moving on to something new. In efforts to keep things fresh, learn something new, and improve the performance of this blog, I am starting to blog with Octopress, which is a blogging platform built on Jekyll.

The advantages of this system include (but are not limited to):

  • It serves static web pages so it’s fast.
  • GitHub offers built-in support so my blog is now in proper source control and hosted for free!
  • The completed website is generated on my machine and pushed to a webserver so I could easily move webhosts at any time.

There are plenty of write-ups about transitioning to a Jekyll-powered blog. Namely I used exitwp to extract the posts.

Octopress includes a pretty decent stylesheet, which made it easy to get up and writing. However, I ended up customizing it that my blog would not look like all of the other Octopress-powered websites out there. Some of the things that I added were:

##Sitemap Octopress included a sitemap plugin, but I didn’t like that it used the file modification time. In theory that works great, but for some reason it always showed every post with the exact same modification time. So I just created my own:

 
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/sitemap.xsl"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>{{ site.url }}/</loc>
    <lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
    <changefreq>daily</changefreq>
    <priority>1.0</priority>
  </url>
  <url>
    <loc>{{ site.url }}/favorite-posts/</loc>
    <lastmod>2012-02-07T20:59:36+00:00</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.6</priority>
  </url>
  <url>
    <loc>{{ site.url }}/about/</loc>
    <lastmod>2012-02-07T20:59:36+00:00</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.6</priority>
  </url>
  <url>
    <loc>{{ site.url }}/my-photo-gear/</loc>
    <lastmod>2012-09-07T20:59:36+00:00</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.6</priority>
  </url>
  {% for post in site.posts  %}
  <url>
    <loc>{{ site.url }}{{ post.url }}</loc>
    <lastmod>{{ post.date | date_to_xmlschema }}</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.2</priority>
  </url>
  {% endfor %}
</urlset> 

##Atom Feed I started with this simple Jekyll feed in order to create a custom Atom Feed that looks like this:

 
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[{{ site.title }}]]></title>
  <subtitle><![CDATA[{{ site.subtitle }}]]></subtitle>
  <link href="{{ site.url }}/atom.xml" rel="self"/>
  <link href="{{ site.url }}/"/>
  <updated>{{ site.time | date_to_xmlschema }}</updated>
  <id>{{ site.url }}/</id>
  <author>
    <name><![CDATA[{{ site.author | strip_html }}]]></name>
  </author>
  <rights>Copyright (c) 2007-2012 {{ site.author | strip_html}}</rights>
  {% for post in site.posts limit: 10 %}
  <entry>
    <title type="html"><![CDATA[{{ post.title | cdata_escape }}]]></title>
    <link href="{{ site.url }}{{ post.url }}"/>
    <updated>{{ post.date | date_to_xmlschema }}</updated>
    <id>{{ site.url }}{{ post.id }}</id>
    <content type="html"><![CDATA[{{ post.content | expand_urls: site.url | cdata_escape }}]]></content>
  </entry>
  {% endfor %}
</feed> 

##Retaining Sidebar Collapsed State The default template for Octopress includes a nifty sidebar that can be collapsed. To improve that functionality, I included the jQuery Cookie plugin and edited the addSidebarToggler function in octopress.js like so:

function addSidebarToggler() {
  if(!$('body').hasClass('sidebar-footer')) {
    $('#content').append('<span class="toggle-sidebar"></span>');
    $('.toggle-sidebar').bind('click', function(e) {
      e.preventDefault();
      if ($('body').hasClass('collapse-sidebar')) {
        $('body').removeClass('collapse-sidebar');
        jQuery(window).trigger("resize");
        jQuery.cookie('sidebar_collapsed', "0", { expires: 7, path: '/', raw: true });
      } else {
        $('body').addClass('collapse-sidebar');
        jQuery(window).trigger("resize");
        jQuery.cookie('sidebar_collapsed', "1", { expires: 7, path: '/', raw: true });
      }
    });
  }
...
}

Additionally I added the following code:

jQuery(document).ready(function () {
    var a = jQuery.cookie("sidebar_collapsed", {
        raw: true
    });
    if (a === "1") {
        $("body").addClass("collapse-sidebar");
    } else {
        $("body").removeClass("collapse-sidebar");
    }
});

Go Get Some Experience

It is pretty easy to read about how to conceptually do something.  It is equally easy to read about how other people have actually done something.  It is an entirely different task to do that something.

Let’s take running a marathon.  It is often referenced in terms of doing something difficult with perseverance.  Yes it is true that it is difficult.  Yes it is true that you need some perseverance (some more so than others simply because they aren’t as ready).  Talking about it, though, requires experience.

When I was younger I chafed at the idea that I could not understand something simply because I had not done it yet.  When I was learning how to drive a car I doubted my parents when they told me that I needed experience.  They essentially claimed that they were better at driving simply because they had done it longer than I have.  I reasoned that I understood the laws better than they, and in fact I probably had better reactions than they did.  So it seemed fairly reasonable that I could drive as well (if not better than) they could.  My how I was young and foolish!  (On a side note I must remember that being foolish is very often associated with being young.)

I have learned that yes, experience does matter.  Nobody buys a book about trading stocks from an author who has never traded stocks.  Nor does one buy a cookbook by someone who could not boil water.  Neither do I want to hear someone extol the virtues of running a marathon if they have not actually run a marathon.  Do you want to talk about running a marathon?  Then run a marathon!  It will give your words more weight.  Alternatively there are countless other examples that you could draw from to prove your point.

Experience does not linearly increases abilities, but I have come to appreciate that experience brings a measure of wisdom.  Oh that’s just great, next thing I know I am going to start calling kids “sonny” and talk about the “good ol’ days”.

Gdansk, Poland

I traveled to Gdansk, Poland in the dead of winter for work. I was there during the 2012 European Cold Wave. I mean you know it’s bad if the Poles thought that it was especially cold! The news broadcast warnings that they should notify the police if they saw people outside sleeping (because they might actually have been dead!). A far cry from sunny southern California to be sure!

San Francisco March 2012

Here are some pictures from a road trip that we took up to San Francisco a little while ago. Most of the stuff that we did was standard for San Francisco, but it was still pleasant!

On Going On A Date (Guy Version)

Take this list and write it down.  Believe in it.  Win it.  Done and done, happily ever after.

  1. Wing It - This is especially important early on.  Everyone likes a man who can improvise.  It’s probably just better to ask her what she wants to do when you pick her up.  Since you know, she might be very particular about the food she eats, the activities that she does, and so on and so forth.  So don’t plan anything specific because it will just be a waste of your time.
  2. Split The Bill - This is the modern age.  Women are the equal of men.  And you know what that means!  She wants you to treat her like an equal.  Plus you know, it might not work out.  Either way you get to save more of your hard-earned money in the process.
  3. Have Her Drive - She probably likes driving anyway.  This will let her practice since girls aren’t as good at driving.  Oh and you’re going to do whatever she wants anyway.  So really, everyone wins.
  4. Avoid Talking As Much As Possible - Just stare.  She’s beautiful, huh?  Talking isn’t necessary.  She’ll be won over by your style, charisma, and wonderful cologne.
  5. Talk About Yourself - When you do have to talk (e.g., she asks you a question) then just make sure to keep the topic of conversation on something that you know.  And what do you know better than yourself and your favorite things?
  6. Come On Strong - Only the serious-minded know that the secret to winning the girl is to either go laid back cool or full-court press.  So if you are going to the latter route then you better go all of the way.  5 course candle-lit dinner, sunset walk on the beach, hired Mariachi band,  horse-drawn carriage.  Go big or go home, buddy.  Everything that you see in those romantic comedies is fair game.  Failing those things, at the very least contact her early and often after the date.  Show her how much you want more.  She’ll reciprocate I’m sure.