Skip to content

Instantly share code, notes, and snippets.

View datt's full-sized avatar
🏠
Working from home

Dattatraya Dongare datt

🏠
Working from home
View GitHub Profile
@prcongithub
prcongithub / CRUDActions
Last active November 4, 2019 07:16
Simple Lightweight module for clean, dynamic and highly optimised API controllers
require 'active_support'
module CRUDActions
extend ActiveSupport::Concern
included do
before_action :set_resource, only: [:show, :update, :destroy]
after_action :set_response_headers, only: [:index]
end
# Returns count of records matching the scope
<% branch_name = `git symbolic-ref HEAD 2>/dev/null`.chomp.sub('refs/heads/', '') %>
<% repository_name = `git rev-parse --show-toplevel`.split('/').last.strip %>
# Check https://gist.github.com/neerajdotname/b9d53f8a234da9d8c007de5e3d98bc21 to see
# details about the restriction on database name
# If you prefer to have branch name in the database name then use following
# database: <%= "#{repository_name}_development_#{branch_name}"[0...63] %>
development:
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@vparihar01
vparihar01 / gist:5575280
Created May 14, 2013 11:32
PERFORMANCE TUNING FOR PHUSION PASSENGER for production ready app.
# PassengerMaxPoolSize
# Default: 6
# For 2gb RAM: 30
# For 256 slice with MySQL running: 2
PassengerMaxPoolSize 2
# PassengerPoolIdleTime
# Recommended to be avg time per page * 2
# In Google Analytics... (Avg time on site / Avg page views) * 2
# Default: 300