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
[alias] | |
ca = commit --amend | |
cf = commit --fixup | |
ci = commit -v | |
cne = commit --amend --no-edit | |
pf = push --force-with-lease | |
ps = push | |
psu = push -u | |
ra = rebase --abort | |
rc = rebase --continue |
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 "rails_helper" | |
RSpec.describe "mutation RegenerateGroupSignupLink" do | |
def mutation | |
mutation = <<~GRAPHQL | |
mutation RegenerateGroupSignupLink($input: RegenerateGroupSignupLinkInput!){ | |
regenerateGroupSignupLink(input: $input){ | |
group { | |
id | |
name |
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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
# Activate the gem you are reporting the issue against. |
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
RSpec.configure do |config| | |
example_sql_counts = Hash.new(0) | |
config.around(:example) do |procsy| | |
sql_count = 0 | |
callback = ->(*args) { sql_count +=1 } | |
ActiveSupport::Notifications.subscribed(callback, "sql.active_record") do | |
procsy.call | |
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 "rspec" | |
require "rspec/autorun" | |
require 'benchmark' | |
n = 1_000 | |
Benchmark.bmbm(7) do |x| | |
x.report("eq:") do | |
RSpec.describe "eq" do | |
n.times do | |
it "tests equality" 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 PostsController < ApiController | |
def index | |
posts = policy_scope([:api, Post.all]) | |
paginator = Paginator.new(posts, params[:page]) | |
render json: PostSerializer.new( | |
paginator.paginated_relation, | |
meta: { | |
total_count: paginator.total_count, | |
}, |
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
alias octo='bundle exec rake' | |
alias octog='bundle exec rake generate' | |
alias octod='bundle exec rake deploy' | |
alias octogd='bundle exec rake generate && bundle exec rake deploy' |