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
| CREATE MATERIALIZED VIEW products_shopify_ids_on_active_shops AS | |
| SELECT shopify_domain, array_agg(col ORDER BY col) AS product_shopify_ids | |
| FROM ( | |
| SELECT DISTINCT | |
| shops.shopify_domain AS shopify_domain, | |
| unnest(offers.offerable_product_shopify_ids) AS col | |
| FROM shops | |
| INNER JOIN offers | |
| ON shops.id = offers.shop_id | |
| INNER JOIN subscriptions |
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 'json' | |
| raw_data = File.read('prod_vars.json') | |
| # {"ASSET_HOST": "https://foo.cloudfront.net", } | |
| vars_info = JSON.parse(raw_data); | |
| puts "### vars_info ###>> #{vars_info.inspect}" |
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
| # frozen_string_literal: true | |
| RSpec.describe Api::V2::DonationsController, type: :request do | |
| let(:donor) { Fabricate(:donor) } | |
| before do | |
| cookies = ActionDispatch::Request.new(Rails.application.env_config.deep_dup).cookie_jar | |
| @tmp = cookies.signed[:donor_jwtapi] = { value: { token: donor.token} , httponly: true } | |
| end |
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) Check your current chrome version: | |
| $ google-chrome --version | |
| Google Chrome 131.0.6778.264 | |
| 2) Download the chromedriver for your version: | |
| $ npx @puppeteer/browsers install [email protected] |
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
| def login_auth0(user) | |
| OmniAuth.config.test_mode = true | |
| # The mock_auth configuration allows you to set per-provider (or default) | |
| # authentication hashes to return during integration testing. | |
| opts = { | |
| provider: 'auth0', | |
| uid: user.auth0_id, | |
| info: { | |
| email: user.email, |
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
| Query to get the last one: | |
| db.fundraisers.find().sort({'_id': -1}).limit(1) | |
| Result: | |
| [ | |
| { | |
| _id: ObjectId("6769c7c016906665787708e1"), | |
| event_name: 'RHA Gala', |
OlderNewer