SameSite=strict cookies is another layer to help prevent CSRF attacts in newer browsers
(at least 5, no clue about earlier versions)
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,3 +1,3 @@| require 'sidekiq/api' | |
| # 1. Clear retry set | |
| Sidekiq::RetrySet.new.clear | |
| # 2. Clear scheduled jobs | |
| Sidekiq::ScheduledSet.new.clear |
| class Delegator(T) | |
| def initialize(@object : T) | |
| end | |
| def self.delegate(object) | |
| new(object) | |
| end | |
| forward_missing_to @object | |
| end |
| # Cleans up branches like: | |
| # if Shopify.rails_next? | |
| # # Rails 5 login | |
| # else | |
| # # Rails 4 login | |
| # end | |
| module RuboCop | |
| module Cop | |
| module ShopifyRails | |
| class RailsNextUnless < Cop |
SameSite=strict cookies is another layer to help prevent CSRF attacts in newer browsers
(at least 5, no clue about earlier versions)
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,3 +1,3 @@| version: '2' | |
| services: | |
| db: | |
| image: postgres:16 | |
| ports: | |
| - "5432:5432" | |
| command: > | |
| postgres | |
| -c shared_preload_libraries='pg_stat_statements' |
| class BaseController | |
| before_action :set_paginable_variant, only: :index | |
| helper_method :paginated_collection | |
| private | |
| def set_paginable_variant | |
| request.variant = :paginable if paginable? | |
| end | |
| #!/bin/bash | |
| f=$(pwd) | |
| sips --resampleWidth 512 "${f}/${1}" --out "${f}/iTunesArtwork" | |
| sips --resampleWidth 1024 "${f}/${1}" --out "${f}/iTunesArtwork@2x" | |
| sips --resampleWidth 20 "${f}/${1}" --out "${f}/Icon-20.png" | |
| sips --resampleWidth 40 "${f}/${1}" --out "${f}/[email protected]" | |
| sips --resampleWidth 60 "${f}/${1}" --out "${f}/[email protected]" |
| ARG ASSET_HOST | |
| RUN bundle exec rake ASSET_HOST=${ASSET_HOST} RAILS_ENV=production assets:precompile |
| Backup: | |
| docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql | |
| Restore: | |
| cat your_dump.sql | docker exec -i your-db-container psql -Upostgres |
| # Assumes the database container is named 'db' | |
| DOCKER_DB_NAME="$(docker-compose ps -q db)" | |
| DB_HOSTNAME=db | |
| DB_USER=postgres | |
| LOCAL_DUMP_PATH="path/to/local.dump" | |
| docker-compose up -d db | |
| docker exec -i "${DOCKER_DB_NAME}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_HOSTNAME}" < "${LOCAL_DUMP_PATH}" | |
| docker-compose stop db |