One line summary (< 50c)
Longer description (wrap at 72c)
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
$('div.message').html(function(index, oldhtml) { | |
return oldhtml.replace(/Removing/,'Fucking') | |
}); |
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 "stateful" | |
class Folder < ActiveRecord::Base | |
include Stateful | |
# ... | |
stateful do | |
state :active | |
state :inactive |
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
#!/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' |
- 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.
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
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 |
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
#!/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) |
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
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)}) |
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
## | |
# 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) |
Just install this in your apps like so:
gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'