Skip to content

Instantly share code, notes, and snippets.

View erochest's full-sized avatar

Eric Rochester erochest

View GitHub Profile
@erochest
erochest / Rakefile
Created September 22, 2011 15:28
Vagrant/Rake config files for setting up a GeoServer instance.
require 'etc'
require 'fileutils'
require 'vagrant'
task :default => :usage
task :usage do
puts "You forgot to tell the computer what to do; try one of these commands:"
@erochest
erochest / index_by_length.rb
Created September 19, 2011 16:13
This indexes the words in a string by length.
# The input.
INPUT = 'The quick brown fox jumped over the lazy dogs. ABCDEF'
# Create a hash that returns an empty Array for missing item accesses.
len_index = Hash.new do |hash, key|
hash[key] = []
end
# Split the input and store each word in the hash, keyed by the length of the
@erochest
erochest / Rakefile
Created September 14, 2011 20:33
Basic Sample Vagrantfile, Rakefile combination for working with OpsCode's and SLab's Chef cookbooks
require 'etc'
require 'fileutils'
require 'vagrant'
task :default => :usage
task :usage do
puts "You forgot to tell the computer what to do; try one of these commands:"
#! /usr/bin/env bash
# install local janus config
curl -L https://gist.github.com/raw/1166018/bfba67168e2f2b74fa7d7debf9ed13ca798429f1/.janus.rake > ~/.janus.rake
# install janus plugins for vim
curl https://raw.github.com/carlhuda/janus/master/bootstrap.sh -o - | sh
# install rvm
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
@erochest
erochest / .janus.rake
Created August 23, 2011 18:05
A .janus.rake file to pull in a rspec2 compiler from tooky/vim-ruby and suppress Windows errors.
require 'rbconfig'
require 'fileutils'
RSPEC2 = 'https://github.com/tooky/vim-ruby/blob/6f7656892806a2a95fb98a562f6531e27e7398c4/compiler/rspec2.vim'
directory 'compiler'
vim_plugin_task 'rspec2' do
if !File.directory?('compiler')
Dir.mkdir('compiler')
-- This script takes the values for enclosure post metadata and adds the length
-- and type fields, if they don't exist.
--
-- The REGEXP /\n[0-9]+\n/ is meant to look for the length field. If it's
-- missing, then the value needs to be patched.
SET @type := 'audio/mpeg';
SET @length := 0;