Skip to content

Instantly share code, notes, and snippets.

View mcmegavolt's full-sized avatar

Alexander Ponomarenko mcmegavolt

View GitHub Profile
@wbotelhos
wbotelhos / clear-sidekiq-jobs.sh
Last active April 2, 2024 10:04
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
@Blohinyuriy
Blohinyuriy / base_controller.rb
Created October 10, 2016 20:09
One view in `app/views/application/` for all controllers where collection needs pagination
class BaseController
before_action :set_paginable_variant, only: :index
helper_method :paginated_collection
private
def set_paginable_variant
request.variant = :paginable if paginable?
end
@ThomasHambach
ThomasHambach / routes.rb
Created February 9, 2015 11:01
Rails redirect to default locale
Rails.application.routes.draw do
scope "/:locale" do
# blablabla..
end
root to: "welcome#index"
get '/:locale' => 'welcome#index', :as => 'locale_root'
end
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/