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
# config/initializers/action_mailer.rb | |
class Rails::MailersController | |
protected | |
# The built in controller has a before_action call to :require_local! We override it here to enable use in production. | |
def require_local! | |
# I use the devise gem with active admin so I call authenticate_admin_user! so that only administrators are allowed to preview email templates. |
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
# = General ================================================================== | |
port 10081 | |
databases 1 | |
loglevel notice | |
logfile /mnt/redis.330229.log | |
# = Security ================================================================= | |
requirepass xxx |
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 Subscription < ActiveRecord::Base | |
PRICING = { | |
1 => { | |
:small => 1300, | |
:medium => 1900, | |
:large => 2400 | |
}.with_indifferent_access, | |
2 => { | |
:small => 16500, |
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
$scope.$evalAsync( | |
function( ) { | |
$('body').append($('<div/>').html("{{coffee}}")) | |
} | |
); |
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
$spring rake test test/integration/signup_test.rb | |
Run options: --seed 13906 | |
# Running: | |
#(Element:0x3fe090fae7f8 { | |
name = "a", | |
attributes = [ | |
#(Attr:0x3fe090fae014 { | |
name = "class", |
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
Refused to display 'https://www.sharecoffeeroasters.com/facebook/contact/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. |
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
<form action="/charge" method="POST"> | |
<script | |
src="https://checkout.stripe.com/checkout.js" class="stripe-button" | |
data-key="pk_test_1xBnoR7Mdwx4E1gD2dcgl8TL" | |
data-image="https://s3.amazonaws.com/stripe-uploads/acct_14qpC2GuKJ7VdKiHmerchant-icon-1419369420301-10846338_1510038909255594_3532245329824431014_n.jpg" | |
data-name="Share Coffee" | |
data-description="2 widgets" | |
data-amount="2000"> | |
</script> | |
<input type='hidden' value='http://example.com/my-custom-url'/> |
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
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb | |
worker: bundle exec sidekiq -c 15 -v -C .config/sidekiq.yml -e $RAILS_ENV |
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
<select | |
name="coffee" | |
id="coffee" | |
class='form-control' | |
ng-model="subscription.great_coffees[$index]" | |
ng-options='coffee as coffee.name group by coffee.category_name for coffee in coffees track by coffee.id' | |
> |
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 String #:nodoc: | |
# ================= | |
# = Class Methods = | |
# ================= | |
def self.alphanumeric(length = 6) | |
(1..length).map{ [(0..9), ('a'..'z'), ('A'..'Z')].map(&:to_a).flatten.sample }.join | |
end | |
# ==================== |