Skip to content

Instantly share code, notes, and snippets.

View Sutto's full-sized avatar

Darcy Laycock Sutto

View GitHub Profile
GitAuth v0.0.4.1
Usage:
add-group NAME [OPTIONS] - Creates a group with a given name
add-repo NAME [PATH=NAME] [OPTIONS] - Creates a named repository, with an optional path on the file system
add-user NAME PATH-TO-PUBLIC-KEY [OPTIONS] - Creates a user with a given public key
install [OPTIONS] - Sets up GitAuth for the current user
ls-groups [OPTIONS] - Lists all groups currently managed by gitauth
ls-repos [OPTIONS] - Lists all repositories currently managed by gitauth
ls-users [OPTIONS] - Lists all users currently managed by gitauth
# Probably not the ideal solution, and from a fish noob
# but it *seems* to work. Hurrah!
function __fish_complete_homebrew_formula
ls (brew --prefix)/Library/Formula | sed s/\.rb//
end
function __fish_complete_brew_has_command --description 'Test if brew is given a command'
set arguments (commandline -opc)
if [ (count $arguments) -lt 2 ]
require 'marvin'
Marvin::DSL.run do
configure do |c|
c.real_name = "Marvin Bot of Doom"
c.user_name = "MarvinBot"
c.nicks = "Marvin", "Marvin_", "Marvin__"
end
logging do
PING github.com (207.97.227.239): 56 data bytes
64 bytes from 207.97.227.239: icmp_seq=0 ttl=49 time=323.309 ms
64 bytes from 207.97.227.239: icmp_seq=1 ttl=49 time=318.121 ms
64 bytes from 207.97.227.239: icmp_seq=2 ttl=49 time=322.837 ms
64 bytes from 207.97.227.239: icmp_seq=3 ttl=49 time=322.139 ms
^C
--- github.com ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 318.121/321.601/323.309/2.052 ms
# Comment if you dont want rubygems
require 'rubygems'
require 'gitauth'
require 'fileutils'
if ARGV.empty?
puts "Usage: ruby #{$0} path-to-base-dir"
exit!
end
require 'test/unit'
require 'shoulda'
require 'rr'
class X
def handle(a, opts = {})
p a, opts
end
require 'rubygems'
require 'rack'
require 'redis_request_limiter'
# Give 5 requests a minute to make testing really easy
use RedisAPILimiter, :per_user_limit => 5, :reset_requests_every => 60
run proc { |env| [200, {"Content-Type" => "text/html", "Content-Length" => "5"}, ["Hello"]]}
require 'rack'
# Released under MIT license, see tests / example.ru for usage
module Rack
class APIVersionMapper
ERROR_TEXT = '<html><head><title>Unknown API Version</title></head><body>Unknown API Version v%s</body></html>'.freeze
EMPTY_RESPONSE = [404, {'Content-Type' => 'text/html', 'Content-Length' => '0'}, ['']].freeze
VERSION_ENV_KEY = 'x-rack.api_mapper.version'.freeze
QUERY_STRING = "QUERY_STRING".freeze
@Sutto
Sutto / checker.erb
Created October 15, 2009 11:30 — forked from ocean/checker.erb
<h1>Feeds Checker</h1>
<%
require 'hpricot'
require 'open-uri'
f1 = open("http://www.commerce.wa.gov.au/feeds/feed1.xml")
feed = Hpricot.XML(f1)
require 'rack'
# sudo gem install tilt --source http://gemcutter.org/
require 'tilt'
# A simple Rack middleware which makes it super easy
# have a shared layout rendering system used across
# different rails applications.
#
# Examples:
#