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 'net/http' | |
require 'uri' | |
def create | |
@subscription = current_user.subscriptions.build(subscription_params) | |
if @subscription.save | |
create_subscription_with_api(@subscription) | |
else | |
redirect_to request.referrer, notice: 'Some error caused in the payment gateway.' |
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 'net/http' | |
require 'uri' | |
def create | |
@subscription = current_user.subscriptions.build(subscription_params) | |
if @subscription.save | |
create_subscription_with_api(@subscription) | |
else | |
redirect_to request.referrer, notice: 'Some error caused in the payment gateway.' |
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
#If the application is deployed using capistarno. | |
cap staging deploy:restart // cap production deploy:restart | |
#if the above command failed due to version controll issue: | |
#Error reports: | |
bundler: command not found: puma | |
Install missing gem executables with `bundle install` |
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
<script src="https://js.stripe.com/v3/"></script> |
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
sudo certbot --nginx --server https://acme-v02.api.letsencrypt.org/directory |
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
<title><%= (yield(:title) unless yield(:title).blank?).to_s + ("Default title" if yield(:title).blank?).to_s %></title> | |
<% content_for :title, "Special title" %> |
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
1) Login to your droplet with super admin privilage. | |
2) Navigate to /etc/postgresql/{version}/main. | |
3) open postgresql.conf sudo nano postgresql.conf | |
add line | |
listen_addresses = '*' | |
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
<div class="select_box"> | |
<select id="test"> | |
<!-- options here --> | |
</select> | |
</div> |
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
// hide the navbar when reached bottom | |
window.addEventListener('scroll', function() { | |
var element = document.querySelector('.site-footer'); | |
var position = element.getBoundingClientRect(); | |
// checking whether fully visible | |
if(position.top >= 0 && position.bottom <= window.innerHeight) { | |
// console.log('Element is fully visible in screen'); | |
}else{ | |
$('.navbar').slideDown(); | |
} |
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
<div id="wave"></div> |