Skip to content

Instantly share code, notes, and snippets.

View saikiranmothe's full-sized avatar

Sai Kiran Mothe saikiranmothe

  • Qwinix Technologies
  • Denver
View GitHub Profile
@saikiranmothe
saikiranmothe / blog_template.rb
Last active December 21, 2015 01:38
blog_temaplte - rails application template
run "rm public/index.html"
add_source "https://rubygems.org"
require 'rbconfig'
require 'open-uri'
require 'net/http'
gsub_file 'Gemfile', "gem 'jquery-rails'", "gem 'jquery-rails', '~> 2.0'"
gem 'devise'
gem 'activeadmin'
@saikiranmothe
saikiranmothe / will_paginate_ajaxify.md
Created August 14, 2013 13:51
Pagination with Ajax in Rails Application
Develop pagination with ajax in Rails Application.

Gem Used for pagination


Add gem in Gemfile

@saikiranmothe
saikiranmothe / spree_application_template.rb
Created August 16, 2013 05:51
Spree Installation -- Spree Application Template
require 'rbconfig'
require 'open-uri'
gsub_file 'Gemfile', "gem 'jquery-rails'", "gem 'jquery-rails', '~> 2.2.1'"
gsub_file 'Gemfile', "# gem 'therubyracer', :platforms => :ruby", "gem 'therubyracer', :platforms => :ruby"
if File.read("#{destination_root}/Gemfile") !~ /assets.+coffee-rails/m
gem "coffee-rails", :group => :assets
end
@saikiranmothe
saikiranmothe / .gitignore.txt
Created August 16, 2013 12:51
gitignore.txt
#----------------------------------------------------------------------------
# Ignore these files when commiting to a git repository.
#
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
#----------------------------------------------------------------------------
# bundler state
/.bundle
/vendor/bundle/
@saikiranmothe
saikiranmothe / postgresql_instalation_ubuntu
Created August 29, 2013 19:21
POSTGRESQL INSTALLATION ON UBUNTU
PostgreSQL
# Install the database packages
sudo apt-get install -y postgresql-9.1 libpq-dev
# Login to PostgreSQL
sudo -u postgres psql -d template1
# Create a user for GitLab. (change $password to a real password)
template1=# CREATE USER git WITH PASSWORD '$password';
@saikiranmothe
saikiranmothe / mysql_ubuntu
Created August 29, 2013 19:23
Mysql installation in ubuntu
MySQL
# Install the database packages
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
# Pick a database root password (can be anything), type it and press enter
# Retype the database root password and press enter
# Login to MySQL
mysql -u root -p
@saikiranmothe
saikiranmothe / database.yml_sqlite3
Created September 16, 2013 16:36
Default SQLite database.yml
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
@saikiranmothe
saikiranmothe / database.yml.MySql_example
Created September 16, 2013 16:39
database.yml_mysql_example
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
@saikiranmothe
saikiranmothe / passenger + nginx+rails
Created October 11, 2013 15:24
passenger + nginx+rails
# install rvm
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
# install ruby 1.9.2 + some global gems
rvm install 1.9.2
rvm use 1.9.2@global
gem install awesome_print map_by_method wirble bundler builder pg cheat
gem install -v2.1.2 builder
@saikiranmothe
saikiranmothe / ubuntu-setup.sh
Created October 11, 2013 15:25
Rackspace Ubuntu -- RVM + PostgreSQL + Passenger + NGiNX setup script
run this script on a fresh Ubuntu server installation as non-root user
# version numbers for various packages
NGINX_VERSION=1.0.8
# copy public ssh key to server's authorized_keys keychain for simple ssh logins
#mkdir -p ~/.ssh
#echo -e '<your ssh public key here>' > ~/.ssh/authorized_keys