Skip to content

Instantly share code, notes, and snippets.

View vitroz's full-sized avatar

Vitor Queiroz vitroz

  • Sao Luis, Brazil
View GitHub Profile
@vitroz
vitroz / gist:e14b63552eaee37d94757a9400e89bae
Created November 27, 2023 16:35
libyears-health-metrics-check
require 'date'
def execute_commands(directory_path, file_name)
# Commands to execute
commands = [
'git checkout main',
'git pull',
'smile-cli run bundle install',
'smile-cli run libyear-bundler',
'smile-cli run libyear-bundler --versions'
fake_accounts = FakeConnectedAccount.all
params = {:limit=>250, :since_id=> 0, :created_at_max=>DateTime.now}
problematic_merchants = []
problematic_merchants_weird = []
fake_accounts.each do |f|
session = ShopifyAPI::Session.new(domain: f.provider_account_uid, token: f.auth_token, api_version:SmileConfig.shopify_app.api_version)
@vitroz
vitroz / gist:b257227ca0d9c21700fb7f10a60d1ec7
Last active February 28, 2023 19:02
Theme Version Check - Ruby Version
#CREATE TABLE fake_connected_accounts (
# id serial PRIMARY KEY,
# provider_account_uid VARCHAR ( 150 ) unique NOT NULL,
# auth_token VARCHAR ( 150 ) NOT NULL,
# account_id numeric not null
#);
# Populate table with merchant sample data (singular merchant x unique theme samples)
# Specify templates required by the app (where app block will be installed).
@vitroz
vitroz / webhook-seed-data
Created January 5, 2023 05:40
required data to run smile-webhook consumers
require_relative 'config/environment'
require_relative 'config/application'
def auth_context
AuthenticatedContext.new(partner_user: third_party_dev)
end
def system_auth_context
AuthenticatedContext.new(system:true)
end
@vitroz
vitroz / gist:120f72c401094765db4422bf6ba397f9
Last active August 31, 2022 20:59
bronto_records_to_delete
table | # of records
app_listings -> #1 (check)
new_integrations -> #163 (check)
webhooks -> #27
webhook_event_definitions_webhooks -> # 27
trackable_tasks (associated to bronto webhooks) -> # 752
trackable_tasks (associated to bronto new integrations) -> # 64
# Specify templates required by the app (where app block will be installed).
# E.g. %w[product collection index blog customers/account list-collections search]
def check_theme_version(theme)
app_block_templates = %w[product collection index]
theme_assets = ShopifyAPI::Asset.find(:all, params: { theme_id: theme.id })
template_json_files = theme_assets.select do |asset|
app_block_templates.any? { |t| asset.key == "templates/#{t}.json"}
end
@vitroz
vitroz / keybase.md
Created June 22, 2021 02:09
proof Keybase

Keybase proof

I hereby claim:

  • I am vitroz on github.
  • I am vitorvqz (https://keybase.io/vitorvqz) on keybase.
  • I have a public key ASBCSX_ix7lMis8WC8pVnOOCXNseK6QfM9i3cVQvRhQiggo

To claim this, I am signing this object: