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!

ruby 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

“`python 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 = []

”`

“`javascript /*! * Rabblescay * Copyright© 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.rabblescaydebug ) 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.rabblescaydebug ) 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 <?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 © 2010, Fusionbox, Inc. */ class Worm {

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

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

} “`

”`bash

!/usr/bin/env bash

———————————————-

Bookmarking for functions

———————————————-

if [[ -z “$FPATH” ]]; then export FPATH=$HOME/.f/unctions fi

if [[ ! -d “$FPATH” ]]; then mkdir -p “$FPATH” 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: _finit elif [[ ”$#“ -eq 1 ]]; then # one arg, and it wasn’t a command _fshow ”$1" else _fadd “${@:1}” fi } “`

”`html <!DOCTYPE html>

<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">

… “`

yaml 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