Skip to content

Instantly share code, notes, and snippets.

View rrichards's full-sized avatar
💭
Rocking the CLI

Ryan Richards rrichards

💭
Rocking the CLI
  • R3 Technologies, Inc.
  • Oklahoma City, OK
  • X @rrichards
View GitHub Profile
require 'open-uri'
require 'hpricot'
user, project = ARGV # 'tobi', 'liquid'
fail "get-github-wiki <username> <projectname>" unless user and project
uri = "http://wiki.github.com/#{user}/#{project}"
xpath = "div.sidebar/ul[1]//a"
command = %w[wget -t 2 -mkc --no-parent]
# rails application template for generating customized rails apps
#
# == requires ==
#
# * rails 2.3+, rspec, cucumber, culerity (langalex-culerity gem), machinist
#
# == a newly generated app using this template comes with ==
#
# * working user registration/login via authlogic, cucumber features to verify that it works
# * rspec/cucumber/culerity for testing
@rrichards
rrichards / rhino_template.rb
Created April 7, 2009 23:47
rails template for skeleton app, haml, sass, shoulda, factory_girl, jquery
# Set up git repository
git :init
# Copy database.yml for distribution use
run "cp config/database.yml config/database.yml.example"
# Set up .gitignore files
run %{find . -type d -empty | xargs -I xxx touch xxx/.gitignore}
file '.gitignore', <<-END
.DS_Store
#!/usr/bin/env ruby
def output_config
puts <<-END
graph_category App
graph_title passenger status
graph_vlabel count
sessions.label sessions
max.label max processes
require 'rubygems'
require 'benchmark'
gem = ARGV.shift.strip rescue ''
if gem == ''
STDERR.puts "usage: #{$0} [gem]"
exit 1
end
`free`
# http://gist.github.com/10524
# Prevents autotest from running your entire test suite after fixing a failed test.
# Works with ZenTest 3.10.0
# Place this in your .autotest file:
require 'rubygems'
require 'active_support'
class Autotest
def run_with_not_rerunning_everything
hook :initialize
@rrichards
rrichards / .zshrc
Created May 29, 2009 03:09 — forked from qrush/.zshrc
# autocompletion for ruby_test
# # works with tu/tf aliases
# # see also ~/bin/ruby_test.rb
_ruby_tests() {
if [[ -n $words[2] ]]; then
compadd `ruby_test -l ${words[2]}`
fi
}
compdef _ruby_tests ruby_test
alias tu="ruby_test unit"
@rrichards
rrichards / git.rake
Created September 15, 2009 05:03 — forked from maxim/git.rake
# Rake tasks for managing git plugins with submodules.
#
# These tasks aim to make life simpler by automating all the boring work.
# What you get:
# - complete git integration (all you need to know is install, uninstall and update)
# - complete github integration (only use author name + plugin name)
# - rails plugin hooks (install.rb/uninstall.rb) are taken care of
#
# Available commands:
#
@rrichards
rrichards / x
Created October 18, 2009 09:27 — forked from zlu/x
CmdUtils.CreateCommand(
{
name: "rails",
takes: {"method": noun_arb_text},
icon: "http://rubyonrails.org/images/rails.png",
homepage: "",
author: {name: "Zhao Lu", email: "zhao.lu.us@gmail.com"},
license: "MPL,GPL",
description: "Search rails documentation",
help: "Type a rails class or method",
@rrichards
rrichards / x
Created October 18, 2009 09:37 — forked from anonymous/x
CmdUtils.CreateCommand({
author: { name: "elbarto", email: "elbarto404@gmail.com"},
description: "search w3schools with google",
name: "w3",
takes: {"w3": noun_arb_text},
preview: function( pblock, searchTerm) {
pblock.innerHTML = "Searches w3schools for: " + searchTerm.text;
},