This file contains 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
module EventExtensions | |
extend ActiveSupport::Concern | |
included do | |
scope :by_category, ->(category) { where.any(categories: category) } | |
end | |
end | |
module NotificationExtensions | |
extend ActiveSupport::Concern |
This file contains 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
# Name of your application. Used to uniquely configure containers. | |
service: hcr_kamal | |
# Name of the container image. | |
image: stephaneliu/hcr_kamal_pg | |
# Deploy to these servers. | |
servers: | |
web: | |
- kamal.hawaiiancrane.com |
This file contains 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
# .rubocop.yml | |
require: | |
- ./lib/custom_cops/vcr/record_strategy.rb | |
# lib/custom_cops/custom_cop_base.rb | |
# frozen_string_literal: true | |
# See https://docs.rubocop.org/rubocop/1.23/development.html for more info on creating new [Rubo]cops | |
module CustomCops | |
class CustomCopBase < RuboCop::Cop::Base |
This file contains 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
--- | |
include: | |
- "**/*.rb" | |
exclude: | |
- spec/**/* | |
- test/**/* | |
- vendor/**/* | |
- ".bundle/**/*" | |
require: [] | |
domains: [] |
This file contains 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 | |
run_check = ENV['SAFE_COMMIT'].nil? | |
if run_check | |
focus_hits = [] | |
binding_hits = [] | |
# Find all filenames in spec directory that have been (A)dded (C)opied or (M)odified | |
filenames = `git diff --cached --name-only --diff-filter=ACM`.split("\n") |
This file contains 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
# https://replit.com/join/eugzahzgxx-stephaneliu1 | |
module GridPrinter | |
def print | |
sleep(0.2) | |
system 'clear' | |
(1..grid_size).each do |row| | |
puts grid[row][1..grid_size].join(' ') | |
end | |
end |
This file contains 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 'net/http' | |
require 'uri' | |
Net::HTTP.get(URI.parse('https://somewhere.com')) |
This file contains 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
# Gemfile | |
group :test do | |
gem "vcr", require: false | |
gem "webmock" | |
end | |
# spec/support/vcr.rb | |
# frozen_string_literal: true | |
require "vcr" |
This file contains 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 Test < Thor | |
include Thor::Actions | |
desc "insert", "an example" | |
def insert | |
content = <<~EOL | |
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }\n\n | |
EOL | |
insert_into_file("spec/rails_helper.rb", content, before: "RSpec.configure do") |
This file contains 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 CreateMailer | |
def initialize(event_catalog, ccir_mailer_policy_class) | |
@event_catalog = event_catalog | |
@ccir_mailer_policy = ccir_mailer_policy_class.new(event_catalog) | |
end | |
def send | |
return false unless ccir_mailer_policy.send_email? | |
# ... | |
end |
NewerOlder