This is a description of how I take care of the animals. Some things have lots of detail, others don’t. Not all of the details are important. The important thing is for the animals to have enough food and water. They’ll let you know if you don’t give them enough.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Takes an OPML file from google reader and spits out a set of <li>s for | |
# each unique blog in the list, sorted by name, with the tags in ()s. | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
def get_tag(opml_node) | |
if opml_node.nil? | |
nil | |
elsif opml_node['htmlUrl'].nil? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a really simple Sinatra extension to make it easy to use compass. | |
# Its configuration isn't all that great, but its usage is: | |
# | |
# require 'sinatra/compass' | |
# get "/main.css" do | |
# compass :main | |
# end | |
require 'sinatra/base' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Text.RegularExpressions; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace SEP.Extensions.Tests | |
{ | |
[TestClass] | |
public class InspectExtensionTests | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'zlib' | |
print Zlib::GzipReader.new($<).read |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def printable(c) | |
c.sub!(/\d/) { |d| "_#{d}" } | |
{ | |
'/' => '_slash_', | |
'_' => '_underscore_' | |
}[c] || c | |
end | |
(0..127).each do |n| | |
c = printable(n.chr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'albacore' | |
require 'rexml/document' | |
# Will submit this as a patch when github starts letting me push again. | |
module Rake | |
class MSBuildTask | |
def define | |
task name do | |
fail unless @msbuild.build | |
end |
Terminal 1:
ruby 01-build-repo.rb test.git
ruby 02b-read-refs.rb test.git
Terminal 2:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// an alternative to http://gist.github.com/158795 | |
// note: this version doesn't deal with cycles at all. | |
private string Inspect(object x) | |
{ | |
return TryNullInspect(x) | |
?? TryInspect<string>(x, s => "\"" + s.Replace("\"", "\\\"")) | |
?? TryInspect<DictionaryEntry>(x, e => "{ " + e.Key + " => " + Inspect(e.Value) + " }") | |
?? TryInspect<IEnumerable>(x, e => "[ " + String.Join(", ", e.Cast<object>().Select(Inspect).ToArray()) + " ]") | |
?? x.ToString(); |