Skip to content

Instantly share code, notes, and snippets.

View spraints's full-sized avatar
🦦

Matt Burke spraints

🦦
View GitHub Profile
# 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 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'
@spraints
spraints / InspectExtensionTests.cs
Created July 30, 2009 17:29
Ruby's inspect for .NET
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace SEP.Extensions.Tests
{
[TestClass]
public class InspectExtensionTests
{
require 'zlib'
print Zlib::GzipReader.new($<).read
def printable(c)
c.sub!(/\d/) { |d| "_#{d}" }
{
'/' => '_slash_',
'_' => '_underscore_'
}[c] || c
end
(0..127).each do |n|
c = printable(n.chr)
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

Taking care of the animals

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.

Winter Schedule

Greenhouse assembly steps

  1. Sort pipes in pole barn into "use" and "not use".
    • "use" go to greenhouse site.
    • "not use" go (?) over the electric fence (?)
  2. Lay out site.
    • Ensure the corners are in the right place.
    • Run string.
  3. Pound in posts. Use a level to make sure they're vertical.

Terminal 1:

ruby 01-build-repo.rb test.git
ruby 02b-read-refs.rb test.git

Terminal 2:

@spraints
spraints / Inspect.cs
Created May 21, 2010 17:09
An alternative to gist: 158795
// 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();