Fork me on GitHub

Started: 20 Jul 2011
github

Ever since getting turned onto zenburn, I've become an evangelist for its subdued tones, eye-friendly highlights, and hours-of-coding-friendly grays.

The screencasts on this site are all taken using Sublime Text 2 and zenburn.tmTheme, and the source code is highlighted using pygments with zenburn.scss.

Code samples!

class MyApplicationController < UIViewController
  def actionTapped
    # Changes the label, and points @label to the next label in the array
    @label.text = 'Good job!'
    @label_index = (@label_index + 1) % @labels.length
    @label = @labels[@label_index]
  end
end
import re

class Node(object):
    """
    Parent class for all nodes (pages and folders)
    """

    # stores the tracked files, which is used to write the timestamps file
    files_tracked = []
    # stores a list of files written, so that stale files can be removed
    files_written = []

    def __init__(self, config, target_folder):
        self.config = config
        self.parent = None
        self.target_folder = target_folder

        self.children = []
/*!
 * Rabblescay
 * Copyright(c) 2011 Colin T.A. Gray
 * MIT Licensed
 */

/**
 * Library version.
 */
var fs = require('fs');

Rabblescay.check = function(word, search, letters)
{
  if ( word.length === 0 )  return true;
  if ( ! word.match(new RegExp('^' + search + '$', 'i')) )
  {
    if ( process.env.rabblescay_debug )  console.log(['check('+word+')'], {
      'doesnt match': search
    });
    return false;
  }

  var examine = search.match(/^([a-z])|(\[.*?\])(\?|[+*]\??|\{[0-9,]+\})?/i);
  if ( process.env.rabblescay_debug )  console.log(['check('+word+')'], {
    'search': search,
    'letters': letters,
    'examine': examine
    });
  if ( ! examine )  return false;

  if ( examine[1] )
  {
    var letter = examine[1];
    if ( process.env.rabblescay_debug )  console.log(['check('+word+')'], {
      'letter': letter
      });
    // skip to next letter and continue
    return Rabblescay.check(word.substring(1), search.substring(1), letters);
  }
  else
  {
    var regex = new RegExp('^' + examine[2] + (examine[3] ? examine[3] : ''), 'i');
    var match = word.match(regex);
    if ( ! match )  return false;
    if ( process.env.rabblescay_debug )  console.log(['check('+word+')'], {
      'regex': regex,
      'match' : match
      });
    var matched = match[0];

    for ( var i = matched.length; i > 0; --i )
    {
      var check_part = matched.substring(0, i);
      if ( ! check_part.match(regex) )  continue;

      if ( process.env.rabblescay_debug )  console.log(['check('+word+')'], {
        'check_part': check_part
        });
      // check letters
      var new_letters = Rabblescay.checkLetters(check_part, letters);
      if ( process.env.rabblescay_debug )  console.log(['check('+word+')'], {
        'new_letters': new_letters
        });
      if ( new_letters && Rabblescay.check(word.substring(check_part.length), search.substring(examine[0].length), new_letters) )  return true;
    }
    // check "empty"
    if ( process.env.rabblescay_debug && ''.match(regex) )  console.log(['checkEmpty('+word+')'], {
      'search': search.substring(examine[0].length),
      'letters': letters
      });

    if ( ''.match(regex) && Rabblescay.check(word, search.substring(examine[0].length), letters) )  return true;
  }
  return false;
};
<?php
/**
 * Worm class: Hooks the ORM into whatever MVC you're using.  In this case,
 * fbmvc.
 *
 * @author Colin T.A. Gray
 * @package Worm
 * @subpackage Base
 * @copyright Copyright (c) 2010, Fusionbox, Inc.
 */
class Worm
{


  static public function config($key)
  {
    return Config::get($key);
  }


  static public function exception($message)
  {
    return new OrmException($message);
  }


}
#!/usr/bin/env bash
#----------------------------------------------
# Bookmarking for functions
#----------------------------------------------

if [[ -z "$F_PATH" ]]; then
  export F_PATH=$HOME/.f/unctions
fi

if [[ ! -d "$F_PATH" ]]; then
  mkdir -p "$F_PATH"
fi


function f()
{
  if [[ -n "$1" && "${1:0:2}" = "--" ]]; then
    cmd="__f_${1:2}"
    if [[ -z `type -t $cmd` ]]; then
      echo "Unknown command \"f $1\"" >&2
      return 1
    fi

    $cmd "${@:2}"
    return $?
  elif [[ -n "$1" && "${1:0:1}" = "-" ]]; then
    cmd="__f_${1:1}"
    if [[ -z `type -t $cmd` ]]; then
      echo "Unknown command \"f $1\"" >&2
      return 1
    fi

    $cmd "${@:2}"
    return $?
  elif [[ "$#" -eq 0 ]]; then
    # no args:
    __f_init
  elif [[ "$#" -eq 1 ]]; then
    # one arg, and it wasn't a command
    __f_show "$1"
  else
    __f_add "${@:1}"
  fi
}
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="msvalidate.01" content="F554F2A760879404A50FF33189AEEB35" />


    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="/static/image/favicon.ico">
    <link rel="apple-touch-icon" href="/static/image/apple-touch-icon.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/static/image/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/static/image/apple-touch-icon-114x114.png">

    <link rel="alternate" type="application/rss+xml" title="stuff by colinta" href="/feed.xml" />


    <link href='http://fonts.googleapis.com/css?family=Wire+One|Anonymous+Pro' rel='stylesheet' type='text/css'>



    <link href="/static/css/bootstrap.css" rel="stylesheet">
    <link href="/static/css/bootstrap-responsive.css" rel="stylesheet">
    <link href="/static/css/colinta.css" rel="stylesheet" type="text/css" media="all">
    <link href="/static/fancybox/jquery.fancybox.css" rel="stylesheet" type="text/css" media="all">
    <link href="/static/css/zenburn.css" rel="stylesheet" type="text/css" media="all">

    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
    <script src="/static/js/bootstrap.js"></script>
    <script src="/static/js/jquery.blockui.js"></script>
    <script src="/static/js/jquery.scrollTo.js"></script>
    <script src="/static/fancybox/jquery.fancybox.js"></script>



    <title>zenburn | stuff by colinta</title>
    <meta name="description" content="">
    <meta name="author" content="Colin T.A. Gray">

<script type="text/javascript">//<![CDATA[

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-15076738-1']);
  _gaq.push(['_trackPageview']);
  _gaq.push(['_trackPageLoadTime']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

//]]></script>


  </head>

  <body>&hellip;</body>
</html>
deploy_path: /var/www/colinta
host: http://colinta.com
meta:
  analytics: 'UA-15076738-1'
  title: stuff by colinta
  header: colinta
author:
  name: Colin T.A. Gray
  github: https://github.com/colinta
  twitter: colinta
extensions:
  - strange_case.extensions.markdown.MarkdownExtension
filters:
  date: strange_case.extensions.date.date
  markdown: strange_case.extensions.markdown.markdown
  json: json.dumps
  sha: strange_case.extensions.hashlib.sha
processors:
  - strange_case.extensions.image
  - strange_case.extensions.category
  - strange_case.extensions.paginated
  - strange_case.extensions.scss