This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.1"></script> | |
<style type="text/css"> | |
html, body, #map { | |
width: 100%; |
This file contains hidden or 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
use Rack::Static, | |
:urls => ["/css", "/images", "/fonts", "/js", "/robots.txt"], | |
:root => "public" | |
run lambda { |env| | |
[ | |
200, | |
{ | |
'Content-Type' => 'text/html', | |
'Cache-Control' => 'public, max-age=86400' |
This file contains hidden or 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
$.getJSON "http://localhost:3000/tags.json", (data) -> | |
items = [] | |
$.each JSONObject.results.bindings, (i, obj) -> | |
items.push [obj.place.value, obj.lat.value, obj.long.value, obj.page.value] | |
$("#post_tag_ids").select2({ | |
tags: items, | |
tokenSeparators: [",", " "] | |
}); |
This file contains hidden or 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
/* | |
* This is a manifest file that'll automatically include all the stylesheets available in this directory | |
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at | |
* the top of the compiled file, but it's generally better to create a new file per style scope. | |
*= require_self | |
*= require bootstrap_and_overrides | |
*= require week_template | |
*/ | |
@import "base_recipes.css.scss"; |
This file contains hidden or 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
# This project is a fork from https://gist.github.com/1254319 that I updated | |
# ~ (http://richardsondx.github.com) | |
#!/usr/bin/env ruby -Ku | |
require "nokogiri" | |
require "iconv" | |
# opens every file in the given dir tree and converts any html img tags to rails image_tag calls |
This file contains hidden or 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
validates :image_or_image_url_is_present, :presence => true | |
def image_or_image_url_is_present | |
errors.add(:image_url, "Image url must be present") if !image_url.blank? | |
end |
This file contains hidden or 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
Then /^I fill in Sign Up Form$/ do | |
user = FactoryGirl.attributes_for(:user) | |
fill_in 'user[name]', :with => user[:name] | |
fill_in 'user[email]', :with => user[:email] | |
fill_in 'user[password]', :with => user[:password] | |
fill_in 'user[password_confirmation]', :with => user[:password] | |
click_on "Next" | |
end |
This file contains hidden or 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
# Note: This is not the old cucumber-rails web_steps.rb | |
# It is a subset of the useful steps that aren't terrible | |
require 'uri' | |
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths")) | |
When /^(?:|I )go to the (.+)(?: page)?$/ do |page_name| | |
visit path_to(page_name) | |
end |
This file contains hidden or 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 OrdersController < ApplicationController | |
include ActiveMerchant::Billing::Integrations | |
before_filter :get_buyer_info, :get_theme, :initializer | |
def initializer | |
app_paypal_email("example_007_biz_api1.gmail.com") | |
setup_seller_profit(75) | |
setup_receivers("[email protected]", "[email protected]") | |
get_buyer_info | |
get_theme |
This file contains hidden or 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
require 'sequel' | |
require 'sequel/extensions/pagination' | |
# ... | |
DB = Sequel.connect(ENV['DATABASE_URL'] || 'postgres://localhost/wind.db') | |
# ... |