Skip to content

Instantly share code, notes, and snippets.

View NielsKSchjoedt's full-sized avatar

Niels Kristian Schjødt NielsKSchjoedt

View GitHub Profile

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@NielsKSchjoedt
NielsKSchjoedt / reindex_concurrenty.rb
Created June 3, 2013 07:44
The class origins back to a sidekiq worker class, so the implementation might not be ideal for stand ole usage, but I think you see the point...
class DailyReindexingJob
#
# Reindexes for performance reasons
#
def perform
tables_to_be_reindexed.each do |tbl|
indexes_for(tbl).each do |idx|
idx_name = idx['relname']