This file contains hidden or 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
puts "error" if __FILE__ = $0 |
This file contains hidden or 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 'rubygems' | |
require 'atom' # sudo gem install atom | |
require 'net/http' | |
require 'uri' | |
feed_url = 'http://search.twitter.com/search.atom?q=meh' | |
begin | |
feed = Atom::Feed.new(Net::HTTP::get(URI::parse(feed_url))) | |
feed.entries.each do |entry| |
This file contains hidden or 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 "rubygems" | |
require "sinatra" | |
require 'atom' #sudo gem install ratom | |
require 'net/http' | |
require 'uri' | |
not_found do | |
headers["Status"] = "301 Moved Permanently" | |
redirect("/") | |
end |
This file contains hidden or 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
# git | |
alias gst="git status" | |
alias ga="git add ." | |
alias gb="git branch" | |
alias gba="git branch -a" | |
alias gl="git pull" | |
alias gh="git push" | |
alias gd="git diff" | |
alias gdm="git diff | mate" | |
alias gc="git commit -v" |
This file contains hidden or 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
" rdoc.vim | |
command! -nargs=0 RDocPreview call RDocRenderBufferToPreview() | |
noremap <buffer> <LocalLeader>rd :RDocPreview<CR> | |
function! RDocRenderBufferToPreview() | |
if (system('which rdoc') == "rdoc not found\n") | |
throw "Could not find rdoc!" | |
end | |
This file contains hidden or 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
class String | |
def translate | |
I18n.t self, :default => self | |
end | |
def t | |
translate | |
end | |
This file contains hidden or 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
class TestGist | |
# test | |
end |
This file contains hidden or 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
# This is a trivial HTTP proxy server, intended for use as a troubleshooting tool | |
# ONLY (not for real, actual, production use). I wrote this because I couldn't find | |
# a simple HTTP proxy that I could use to test HTTP proxy support in Net::SSH. | |
# | |
# This code is in the public domain, so do with it what you will! | |
require 'socket' | |
server = TCPServer.new('127.0.0.1', 8080) | |
client = server.accept |
This file contains hidden or 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
# haml + liquid example | |
# | |
# James MacAulay 2009 | |
require 'rubygems' | |
require 'liquid' | |
require 'haml' | |
template = <<EOF |
This file contains hidden or 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 File.dirname(__FILE__) + '/../spec_helper' | |
describe CategoriesController, "GET #index" do | |
subject { controller } | |
before(:each) { get :index } | |
it { should assign_to(:categories) } | |
it { should respond_with(:success) } | |
end |
OlderNewer