Skip to content

Instantly share code, notes, and snippets.

@PurpleBooth
PurpleBooth / README-Template.md
Last active May 9, 2024 19:52
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@isaacbowen
isaacbowen / will_paginate.rb
Created August 30, 2011 21:37
extends will_paginate to play well with Twitter's Bootstrap
# config/initializers/will_paginate.rb
module WillPaginate
module ActionView
def will_paginate(collection = nil, options = {})
options[:renderer] ||= BootstrapLinkRenderer
super.try :html_safe
end
class BootstrapLinkRenderer < LinkRenderer
@shad
shad / better-textmate-rspec-puts.rb
Created March 5, 2010 22:34
An Improved puts for rspec in Textmate.
# Improved "puts" in Textmate's version of rspec
if ENV['TM_MODE'] == 'RSpec'
alias :orig_puts :puts
def puts(str)
str = '[nil]' if str.nil?
str = '' if str.blank?
url, line = caller[0].split(":")
md = caller[0].match(/[\\\/]([^\\\/]*:\d+):(.*)/)
link_text = md[1]
title = md[2]