Skip to content

Instantly share code, notes, and snippets.

View rpheath's full-sized avatar

Ryan Heath rpheath

View GitHub Profile
template(:rph) do
gem 'RedCloth'
gem 'mislav-will_paginate'
gem 'ruby-openid'
plugin 'rspec', :git => 'git://github.com/dchelimsky/rspec.git'
plugin 'rspec-rails', :git => 'git://github.com/dchelimsky/rspec-rails.git'
plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git'
plugin 'open_id_authentication', :git => 'git://github.com/rails/open_id_authentication.git'
plugin 'hoptoad_notifier', :git => 'git://github.com/thoughtbot/hoptoad_notifier.git'
require 'colored'
def banner(title, pad = 85)
puts "\n#{title} ".ljust(pad, "*").yellow
end
def stripe
puts ("-" * 84 + "\n").yellow
end
module States
def self.abbreviation_for(state)
LIST.invert[state]
end
def self.to_options
LIST.merge("--" => nil).sort
end
LIST = {
// jQuery plugin:
// converts a float number as text in some element
// into US currency
//
// Ex:
// <span id="price">1234988.3400</span>
//
// $('span#price').toCurrency()
// => <span id="price">$1,234,988.34</span>
(function($) {
// tooltip plugin for jQuery
(function($) {
$.fn.tooltip = function(options) {
var options = $.extend({
xOffset: 30,
yOffset: 7,
follow: false
}, options)
// jQuery plugin
// - will adjust a content area to be at least as
// tall as the sidebar area
// Ex:
// $('#content').adjustHeightWithSidebar()
// $('#content').adjustHeightWithSidebar({sidebar_selector: '#side-bar'})
(function($) {
$.fn.adjustHeightWithSidebar = function(options) {
settings = $.extend({
// An unobtrusive Textile editor in jQuery
// Inspired by: http://slateinfo.blogs.wvu.edu/plugins/textile_editor_helper
//
// Usage:
// $(function() {
// $('textarea.textile').textilize();
// )(jQuery);
//
(function($) {
$.textileEditor = function(textarea, options) {
// global to store a reference
// to the timed autoplay slideshow
var autoplay = null
// Slideshow object
var Slideshow = {
inited: false,
// default settings when
// calling Slideshow.play()
// Provides default text in a textbox that disappears when focused
// Note: also toggles an 'active' CSS class so you can change text color
(function($) {
$.fn.friendlyTextBox = function(msg) {
var regex = new RegExp('^' + msg + '$')
$(this).focus(function() {
if ($(this).val().match(regex)) $(this).val('')
$(this).addClass('active')
#! /bin/sh
### BEGIN INIT INFO
# Provides: mongodb
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the mongodb data-store
# Description: starts mongodb using start-stop-daemon