If checkout doesnt work well can use the payment intents API
Simple Difference Comparison: https://stripe.com/docs/payments/payment-intents/migration/charges Code Example: https://gist.github.com/westonganger/6ac28553b13a0bc7fe07dcf8d86ce3bd
If checkout doesnt work well can use the payment intents API
Simple Difference Comparison: https://stripe.com/docs/payments/payment-intents/migration/charges Code Example: https://gist.github.com/westonganger/6ac28553b13a0bc7fe07dcf8d86ce3bd
/* Note: The html string returned fron this method will not contain any actual remotely referenced JS/CSS just the HTML as in the source */ | |
window.get_html_snapshot = function(hideItems, hideClasses){ | |
hideItems = hideItems || false; | |
hideClasses = hideClasses || ".modal, .modal-backdrop"; | |
var input_types_to_skip = ["button", "submit", "file", "image", "password"]; | |
// First write all input[type=text] field value so they can be seen when HTML is loaded | |
$('input').each(function(){ |
// Links | |
// https://stackoverflow.com/questions/951791/javascript-global-event-mechanism | |
// https://stackoverflow.com/a/49560222/3068360 | |
// https://stackoverflow.com/questions/5328154/catch-all-javascript-errors-and-send-them-to-server | |
window.addEventListener('error', function(event) { | |
// Instead of window.onerror we use addEventListener with capture option set to true to get the most errors | |
// window.onerror = function(message, file, line, col, error){ | |
// https://stackoverflow.com/q/54209739/3068360 | |
Source Article (See for latest changes): https://westonganger.com/posts/using-postgresql-fdw-with-activerecord-and-rails
If you want to do some cross database joins or includes across postgresql databases regardless of local or remote databases you can use Postgres FDW. Its an awesome tool for the job when you want to avoid data replication.
class PostgresFdwBase < ApplicationRecord
### Article to familiarize with concepts in this models methods - https://thoughtbot.com/blog/postgres-foreign-data-wrapper
# config/environments/static.rb | |
require File.expand_path('../development', __FILE__) | |
# environment for serving static pages like error pages to upload to S3 | |
MyApp::Application.configure do | |
config.serve_static_assets = true | |
# Compress JavaScripts and CSS | |
config.assets.compress = true |
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
import csv | |
import urllib.request | |
url = "http://nopaystation.com/tsv/PS3_GAMES.tsv" | |
print('Downloading PS3_GAMES.tsv...') | |
urllib.request.urlretrieve(url, 'PS3_GAMES.tsv') | |
newlist = [] | |
with open('PS3_GAMES.tsv', newline='', encoding="utf8") as csvfile: | |
listreader = csv.reader(csvfile, delimiter=' ', quotechar='"') |
class ApplicationJob < ActiveJob::Base | |
around_perform do |job, block| | |
Honeycomb.start_span(name: job.class.name) do |span| | |
span.add_field 'type', 'worker' | |
span.add_field 'queue.name', job.queue_name | |
block.call | |
end | |
end | |
end |
db/schema.rb merge=railsschema |
# One liner | |
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
# Explained | |
wget \ | |
--recursive \ # Download the whole site. | |
--page-requisites \ # Get all assets/elements (CSS/JS/images). | |
--adjust-extension \ # Save files with .html on the end. | |
--span-hosts \ # Include necessary assets from offsite as well. | |
--convert-links \ # Update links to still work in the static version. |