category: Code

Gmail “High Score” Theme

December 15, 2011

So Gmail has a theme called “High Score” which Kristi and I both use. If you afk from an open chat window for a bit, you might come back to see this:

where that top thing is a gif that looks like this:

Anyway, we wanted a playable version. So here it is. Also a fun exercise in javascript classes and html5 canvases. Oh and, it only works in chrome. Here’s the github.

Update! kristi adds Firefox compatibility and scorekeeping!

Gist Embedding with Sliding

November 20, 2011

I’ve been looking for a solution to code posting on wordpress. I think I’ve found it in the form of Gist, Embed Github Gist, and a jquery addon I just put together called hoverslide.

The Gist embed option prints out something like this:

<div id="gist-1378474" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="gist-highlight">
                  <pre><div class="line" id="LC1"><span class="k">print</span> <span class="s">"hello world"</span></div></pre>
              </div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1378474/e2c085668a827762eb6a4faab981abe266615f07/blerp.py" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1378474#file_blerp.py" style="float:right;margin-right:10px;color:#666">blerp.py</a>
            <a href="https://gist.github.com/1378474">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>

</div>

The usage of hoverslide looks something like this:

$(document).ready(function() {
$(".gist").hoverSlide(330);
}

The styling for gist is pulled from this css which I’ve included in my header and made small changes to.