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> | |
<head> | |
<title>Stripe OAuth Example</title> | |
</head> | |
<body> | |
<%= @access_token %> | |
</body> | |
</html> |
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
context "#start_phone_call", :focus do | |
before :each do | |
@harry = FactoryGirl.create(:client, first_name: "Harry", stripe_customer_token: nil) | |
@arnold = FactoryGirl.create(:lawyer, first_name: "Arnold") | |
controller.stubs(:current_user).returns(@harry) | |
end | |
it "should redirect to payment info page unless client has already has it saved" do | |
get :start_phone_call, { id: @arnold.to_param, client_number: "6087004680" } | |
request.should redirect_to call_payment_path(@arnold.to_param) |
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
jQuery -> | |
($ ".dots-switcher").each (index, list) -> new DotsSwitcher(list) | |
class DotsSwitcher | |
constructor: (container) -> | |
@container = ($ container); | |
@items = @container.find("li") | |
@count = @items.length | |
@makeDots() | |
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
jQuery -> | |
# Model | |
class window.LineItem extends Backbone.Model | |
url: -> if @id then "/line_items/#{@id}?" else "/line_items?appointment_id=#{parseInt(($ 'input#appointment_id').val())}" | |
clear: -> | |
@destroy() | |
@view.remove() | |
# Collection |
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
en: | |
devise: | |
invitations: | |
send_instructions: 'An invitation email has been sent to %{email}.' | |
invitation_token_invalid: 'The invitation token provided is not valid!' | |
updated: 'Your password was set successfully. You are now signed in.' | |
no_invitations_remaining: "No invitations remaining" | |
mailer: | |
invitation_instructions: | |
subject: 'Invitation instructions' |
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
<p>Hello <%= @resource.email %>!</p> | |
<p>Someone has invited you to <%= root_url %>, you can accept it through the link below.</p> | |
<p><%= link_to 'Accept invitation', accept_invitation_url(@resource, :invitation_token => @resource.invitation_token) %></p> | |
<p>If you don't want to accept the invitation, please ignore this email.<br /> | |
Your account won't be created until you access the link above and set your password.</p> |
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
# These are my notes from the PragProg book on CoffeeScript of things that either | |
# aren't in the main CS language reference or I didn't pick them up there. I wrote | |
# them down before I forgot, and put it here for others but mainly as a reference for | |
# myself. | |
# assign arguments in constructor to properties of the same name: | |
class Thingie | |
constructor: (@name, @url) -> | |
# is the same as: |
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 lang="en-US"> | |
<head> | |
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"> | |
<title><%= yield :title %></title> | |
<%= stylesheet_link_tag "reset", "application" %> | |
<%= javascript_include_tag "jquery.min", "application", "rails" %> | |
<%= csrf_meta_tag %> | |
</head> | |
<body> |
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
var DateHelper = { | |
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time | |
// Ruby strftime: %b %d, %Y %H:%M:%S GMT | |
time_ago_in_words_with_parsing: function(from) { | |
var date = new Date; | |
date.setTime(Date.parse(from)); | |
return this.time_ago_in_words(date); | |
}, | |
time_ago_in_words: function(from) { |
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
# find_created_in_last(7.months) | |
def self.find_started_in_last(time_span) | |
old_time = Date.today - time_span | |
all(:conditions => ["created_at > ?", old_time.to_s(:db)]) | |
end |