Skip to content

Instantly share code, notes, and snippets.

@mishrarohit
mishrarohit / gist:fee3f3cd0fb96dd5b88a
Last active June 1, 2016 05:20 — forked from veganstraightedge/gist:1063033
blacklist of usernames
about
aboutus
account
add
admin
angel_info
api
app
app_faqs
apps
# Taken from http://www.rostamizadeh.net/blog/2012/04/14/precompiling-assets-locally-for-capistrano-deployment
# If we use asset_sync /CDN or maintenance page, try this instead
# http://p373.net/2013/05/14/rails-deployments-from-4-minutes-to-40-seconds/
before 'deploy:finalize_update', 'deploy:assets:symlink'
after 'deploy:update_code', 'deploy:assets:precompile'
namespace :deploy do
namespace :assets do
@mishrarohit
mishrarohit / notification.rb
Created October 19, 2013 10:32
The new notification model for Allotrop
# == Schema Information
#
# Table name: notifications
#
# id :integer not null, primary key
# user_id :integer
# category :string(255)
# post_id :integer
# data :hstore
# created_at :datetime
@mishrarohit
mishrarohit / allotrop_old_repost_notification.rb
Created October 19, 2013 09:35
The old notifications code for Allotrop. This is bad in too many ways. I have completely redone Allotrop notifications. This is out there as a reminder of the bad pattern that I used.
# Old Allotrop code for repost notifications
class RepostNotificationWorker
include Sidekiq::Worker
def perform(repost_id)
# debugger if Rails.env.development?
repost = Post.find(repost_id)
unless repost.nil?
@mishrarohit
mishrarohit / gist:6415537
Last active December 22, 2015 04:09
Install Rails on Ubuntu 12.04 with Nginx, Unicorn and Mysql.
# These instructions are based on Ryan Bates' deploying to VPS Railscasts -- http://railscasts.com/episodes/335-deploying-to-a-vps
$ ssh root@178.xxx.xxx.xxx
root@li349-144:~# apt-get update
root@li349-144:~# apt-get -y install curl git-core python-software-properties
root@li349-144:~# add-apt-repository ppa:nginx/stable