Skip to content

Instantly share code, notes, and snippets.

View vinbarnes's full-sized avatar

Kevin R. Barnes vinbarnes

View GitHub Profile

Writing Commit Messages

One line summary (< 50c)

Longer description (wrap at 72c)

Summary

$('div.message').html(function(index, oldhtml) {
return oldhtml.replace(/Removing/,'Fucking')
});
require "stateful"
class Folder < ActiveRecord::Base
include Stateful
# ...
stateful do
state :active
state :inactive
#!/usr/bin/env ruby
#
# A quick script to dump an overview of all the open issues in all my github projects
#
require 'octokit'
require 'awesome_print'
require 'rainbow'
@vinbarnes
vinbarnes / baltimore_hipster_guide.mdown
Created May 15, 2011 19:09 — forked from pjb3/baltimore_hipster_guide.mdown
Hipster's Guide to Baltimore by @bmuller

Food

  • Little Italy has a number of great places (I think Amicci's has the best happy hour) and is accessible by the circulator's Orange Line.
  • Best pizza/risotto is Joe Squared on North Ave (purple line accessible).
  • Best Mexican is La Guadalupana on 500 South Wolfe Street (Orange/Green route will get you there). You will need to know some basic Spanish to order there, but the food is amazing.
  • Best odd assortment of random food is Lexington Market, the longest running market in the world(according to Wikipedia). It's accessible by heading north on the light rail and then walking West and would be good for lunch one day.
  • Best fancy food is Woodberry Kitchen, which is light rail accessible.
  • Best late night food is Never on Sunday on N Charles across the street from Helmand, which is open until 3:30am.
  • Best sushi is an easy pick - Kiku (1017 Light Street). It's a literal Mom and Pop operation with an amazing chirashi.
@vinbarnes
vinbarnes / gist:1092838
Created July 19, 2011 15:46 — forked from jaminguy/gist:1092835
Dalli Sinatra Test
get '/dalli_test' do
some_var = settings.cache.get('some_var')
if some_var
"some_var is not nil: #{some_var}\n"
else
"some_var is nil: #{some_var}\n"
settings.cache.set('some_var', 'some_value')
end
end
#!/bin/bash
TARGET_HOST='hoenir.websages.com'
TMP=$(mktemp -d /tmp/sslcert.XXXX)
cat<<EOF > ${TMP}/openssl.cnf
[ req ]
distinguished_name = req_distinguished_name
req_extensions = v3_req
[ req_distinguished_name ]
countryName = Country Name (2 letter code)
irbbarnekr@saturnino ~ $ irb
>> def wham(mark, list)
>> list.each {|item| puts "#{item} got whammed!"}
>> end
=> nil
>> def subscribe(mark, list, callback)
>> callback.call(mark, list)
>> end
=> nil
>> subscribe('one', %w[buddy guy], Proc.new {|*args| wham(*args)})
@vinbarnes
vinbarnes / mini.rb
Created February 13, 2012 05:34 — forked from defunkt/mini.rb
test/spec/mini 5 - nested contexts, stacked setups
##
# test/spec/mini 5
# http://gist.github.com/307649
# chris@ozmm.org
#
def context(*args, &block)
return super unless (name = args.first) && block
require 'test/unit'
klass = Class.new(defined?(ActiveSupport::TestCase) ? ActiveSupport::TestCase : Test::Unit::TestCase) do
def self.test(name, &block)
@vinbarnes
vinbarnes / gemspec-usage.md
Created February 13, 2012 05:34 — forked from holman/gemspec-usage.md
test/spec/mini

Just install this in your apps like so:

gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'