Skip to content

Instantly share code, notes, and snippets.

View aashishpsaini's full-sized avatar
💻
Working Remotely

Aashish Saini aashishpsaini

💻
Working Remotely
View GitHub Profile
@aashishpsaini
aashishpsaini / using-rack-mini-profiler.md
Created September 20, 2024 13:37 — forked from sandip-mane/using-rack-mini-profiler.md
Performance testing with rack-mini-profiler

Adding rack-mini-profiler

  • Add to Gemfile, under development group
# Performance monitoring
gem "rack-mini-profiler"
  • Add a initializer, i.e. config/initializers/mini_profiler.rb
@aashishpsaini
aashishpsaini / clear-sidekiq-jobs.sh
Created September 20, 2024 13:37 — forked from wbotelhos/clear-sidekiq-jobs.sh
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
@aashishpsaini
aashishpsaini / arel_cheatsheet_on_steroids.md
Created September 20, 2024 13:37 — forked from ProGM/arel_cheatsheet_on_steroids.md
Arel cheatsheet on Steroids

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias

First fire this command:
rails db:drop db:create && rake db:schema:load && rake db:migrate:with_data && redis-cli FLUSHDB && redis-cli flushall
If you need to use seeds, call this:
rake db:seed --trace