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
| class ApplicationJob < ActiveJob::Base | |
| include ActiveSupport::Rescuable | |
| # PG::QueryCanceled will be wrapped with ActiveRecord::QueryCanceled errors and it's a direct | |
| # descendant of ActiveRecord::StatementInvalid error. | |
| rescue_from ActiveRecord::StatementInvalid do |exception| | |
| # It's hard to know, on which queries we're seeing statement timeouts -- so we are making this explicit in AppSignal error. | |
| Appsignal::Transaction.current.set_sample_data("custom_data", sql_statement: exception.sql) | |
| raise exception | |
| 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
| # config/environments/test.rb | |
| ActiveSupport.on_load(:active_record_postgresqladapter) do | |
| # For this optimization to work, you need to recreate your test database | |
| self.create_unlogged_tables = 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
| CREATE TABLE people ( id INTEGER PRIMARY KEY AUTOINCREMENT, first_name TEXT NOT NULL, last_name TEXT, dob TEXT, name TEXT, photo TEXT, notes TEXT); | |
| CREATE TABLE sqlite_sequence(name,seq); | |
| CREATE TABLE IF NOT EXISTS "contacts" ( | |
| "id" integer NOT NULL, | |
| "type" text NOT NULL CHECK(type in ('work', 'mobile', 'home', 'email')), | |
| "value" text NOT NULL, | |
| "people_id" integer NOT NULL, | |
| PRIMARY KEY("id" AUTOINCREMENT), | |
| FOREIGN KEY("people_id") REFERENCES "people"("id"), | |
| UNIQUE("type","value") |
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
| 2.7.6 |
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
| FROM ghcr.io/renderinc/heroku-app-builder:heroku-20 AS builder | |
| # The FROM statement above triggers the following steps | |
| # 1. Copy the contents of the directory containing this Dockerfile to a Docker image | |
| # 2. Detect the language | |
| # 3. Build the app using the appropriate Heroku buildpack. All Heroku's official buildpacks are supported. | |
| # For running the app, we use a clean base image and also one without Ubuntu development packages | |
| # https://devcenter.heroku.com/articles/heroku-20-stack#heroku-20-docker-image | |
| FROM ghcr.io/renderinc/heroku-app-runner:heroku-20 AS runner |
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
| #!/usr/bin/env ruby | |
| require 'bundler' | |
| require 'csv' | |
| lock_file = Bundler::LockfileParser.new(Bundler.read_file("Gemfile.lock")) | |
| def url_for(spec) | |
| case spec.source | |
| when Bundler::Source::Rubygems |
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 'ostruct' | |
| require 'benchmark' | |
| COUNT = 10_000_000 | |
| NAME = "Test Name" | |
| EMAIL = "[email protected]" | |
| class Person | |
| def initialize(name:, email:) | |
| @name = name |
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
| source 'https://rubygems.org' | |
| git_source(:github) do |repo_name| | |
| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") | |
| "https://github.com/#{repo_name}.git" | |
| end | |
| ruby '2.6.6' | |
| gem 'pronto' |
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
| pre-commit: | |
| parallel: true | |
| commands: | |
| eslint: | |
| glob: "*.{js}" | |
| run: yarn prettier --write {staged_files} && yarn eslint {staged_files} && git add {staged_files} | |
| css: | |
| glob: "*.{css}" | |
| run: yarn prettier --write {staged_files} && git add {staged_files} | |
| rubocop: |
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
| #!/bin/bash | |
| BRANCH_CHANGE=$3 | |
| [[ $BRANCH_CHANGE -eq 0 ]] && exit | |
| PREV_HEAD=$1 | |
| CURR_HEAD=$2 | |
| [ $PREV_HEAD == $CURR_HEAD ] && exit | |
| # Don't run bundler if there were no changes in gems |