This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% content_for :head do %> | |
<%= stylesheet_link_tag 'path/to/css' %> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get '/' do | |
@title = "ThePostBin - Home" | |
if user_id = session[:user_id] | |
@user = User.find(user_id) | |
end | |
haml :index | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="kill_ie"><img src="/bsod.png"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VCR.configure do |config| | |
config.cassette_library_dir = 'spec/cassettes' | |
config.hook_into :fakeweb | |
config.configure_rspec_metadata! | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class USPSAddress | |
EXEMPT_ADDRESS_PARTS = ["NW", "NE", "SW", "SE"] | |
def initialize | |
@usps = USPS.new(USPS_USER_ID) | |
end | |
def parse_address(address) | |
location = Location.new(address) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Contact Us</title> | |
</head> | |
<body> | |
<?php | |
if ($_POST['message']) { | |
$message = $_POST['message']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="navbar"> | |
<div class="navbar-inner"> | |
<div class="container"> | |
<a class="brand" href="#"> | |
<%= image_tag('G5_logo.png') %> Reputation Manager | |
</a> | |
<% if user_signed_in? %> | |
<% present current_user do |user_presenter| %> | |
<ul class="nav pull-right"> | |
<% if rollout? :workflow %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Customer < User | |
# on the following comma-sep list, ONLY append values to the end! | |
has_preferences :hide_deleted_stores | |
def is_employee? | |
false | |
end | |
def is_customer? | |
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def padded_store_link direction | |
user_store_ids = current_user.store_ids_for_client(@client) | |
client_store_ids = @client.stores.map(&:id) | |
sorted_user_store_ids = client_store_ids.select { |i| user_store_ids.include?(i) } | |
index = sorted_user_store_ids.index(@store.id) | |
puts "INDEX #{index}" | |
if direction == "next" | |
id = sorted_user_store_ids[index+1] |