Skip to content

Instantly share code, notes, and snippets.

View eebs's full-sized avatar

Eebs Kobeissi eebs

View GitHub Profile
@eebs
eebs / gitconfig
Created November 16, 2022 18:10
Useful git aliases
[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
@eebs
eebs / regenerate_group_signup_link_spec.rb
Created May 31, 2022 19:41
GraphQL Mutation Testing
@eebs
eebs / reproduction.rb
Created July 24, 2020 18:22
Rails reproduction showing params.require(:user) expects a specific format
# 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.
@eebs
eebs / sql_statement_profiling.rb
Created December 17, 2019 21:29
spec/support/sql_statement_profiling.rb
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
@eebs
eebs / truthy.rb
Last active October 21, 2019 20:24
Truthy Benchmark
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
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,
},
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'