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
Stripe.api_key = "YOUR_API_KEY" | |
token = params[:stripeToken] | |
charge = Stripe::Charge.create( | |
:amount => 1000, # amount in cents, again | |
:currency => "usd", | |
:card => token, | |
:description => "something about your customer" | |
) |
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
token = params[:stripeToken] | |
customer = Stripe::Customer.create( | |
:card => token, | |
:plan => "medium", | |
:email => "customeremail@example.com" | |
) |
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
<% ps = Post.where(:author => "Dhaivat Pandya", :blog => "Something", | |
:language => "English", :market => "developers")[0] %> | |
<% if ps.time_posted.nil? %> | |
Oops, using old system please revert. | |
<% end %> | |
<div id="times"> | |
<span class="age"><%= Date.today - ps.time_posted %></span> | |
<span class="age_edited"><%= Date.today - ps.time_edited %></span> |
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 User < ActiveRecord::Base | |
... | |
def self.find_logins_at_time(time) | |
#method implementation | |
end | |
... | |
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
<% if no_time_included %> | |
Oops, using old system please revert. | |
<% end %> | |
<div id="times"> | |
<span class="age"><%= @age %></span> | |
<span class="age_edited"><%= @age_edited %></span> | |
</div> | |
<div id="post-<%= @id %>" data-id="<%= @p_id %>"> |
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
forward 1 | |
left 16 | |
forward 5 | |
right 6 | |
backward 3 |
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
forward 1 | |
fire | |
backward 2 | |
fire | |
right 16 | |
fire | |
backward 2 | |
fire | |
left 2 |
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 Robot | |
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 Robot | |
def forward | |
end | |
def backward | |
end | |
def right | |
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 Robot | |
def forward | |
puts "forward" | |
end | |
def backward | |
puts "backward" | |
end | |
def right |