Skip to content

Instantly share code, notes, and snippets.

View dpickett's full-sized avatar

Dan Pickett dpickett

View GitHub Profile
irb(main):001:0> require 'rubygems'
=> false
irb(main):002:0> require 'hmac/sha1'
LoadError: no such file to load -- hmac/sha1
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
<html>
<head>
<title>Payment Sent</title>
</head>
<body>
<%= automated_line %>
<p>Hi <%= @contact_information.display_name %>,</p>
<html>
<head>
<title>Payment Sent</title>
</head>
<body>
<p>THIS IS AN AUTOMATED EMAIL</p>
<p>Hi ,</p>
rescue_from ActionController::UnknownAction, :with => :render_not_found_error
rescue_from ActionController::UnknownController, :with => :render_not_found_error
<%- tab_menu "User Menu" do |t| %>
<%= t.tab "Favorite Users", user_url(@user) %>
<%- end -%>
@message = Factory.build(:message)
@message.recipients << Factory(:user, :login => "recipients")
@message.save! #fail
user = Factory(:user)
@message = Factory(:message, :recipients => [User.find(:first)]) #great success
require File.dirname(__FILE__) + '/../spec_helper'
class Message
has_many :copies
has_many :recipients, :through => :copies
end
class MessageCopy
belongs_to :recipient
belongs_to :message
<script type="text/javascript" charset="utf-8">
var search_constant = "Enter a diagnosis name ...";
function setSearchConstant(){
if("" == $("#search_term").val())
{
$("#search_term").val(search_constant);
}
}
$(document).ready(function(){
<div class="not_found">
<img src="/images/not_found_overlay.png" alt="Not found dude"/>
<img src="/images/troggles/eddie.png" alt="" />
</div>
where troggles/*baddy*.png is a randomized array of
eddie, helpers, bashful, workers, smarties
def get_random_troggle_image(options = {})
image_tag(get_random_troggle_image_path, {:class => "troggle"}.options)
end
def troggle_image_paths
path_prefix = "/images/troggles"
@troll_paths ||= [
"#{path_prefix}/bashful.png",
"#{path_prefix}/helpers.png",
"#{path_prefix}/reggies.png",