Skip to content

Instantly share code, notes, and snippets.

:octocat:
Focusing

kamal namdeo kamal-github

:octocat:
Focusing
Block or report user

Report or block kamal-github

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kamal-github
kamal-github / database.yml
Created Dec 19, 2014
database.yml for memory realive
View database.yml
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
@kamal-github
kamal-github / app_name
Created Nov 19, 2015 — forked from zacksiri/app_name
nginx config
View app_name
upstream unicorn {
server unix:/tmp/unicorn.app_name.sock fail_timeout=0;
}
server {
server_name domain.com www.domain.com;
listen 80 default deferred;
root /opt/apps/app_path/public;
View unicorn.rb
# Sample verbose configuration file for Unicorn (not Rack)
#
# This configuration file documents many features of Unicorn
# that may not be needed for some applications. See
# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb
# for a much simpler configuration file.
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
View postgres_and_redis.md

Postgres

Configure so that the vagrant user doesn't need to provide username and password.

apt-get -yqq install postgresql postgresql-contrib-9.3 libpq-dev postgresql-server-dev-9.3
su - postgres
createuser --createdb --superuser -Upostgres vagrant
psql -c "ALTER USER vagrant WITH PASSWORD 'password';"
psql -c "create database discourse_development owner vagrant encoding 'UTF8' TEMPLATE template0;"
psql -c "create database discourse_test        owner vagrant encoding 'UTF8' TEMPLATE template0;"
View ruby and rvm
## Postgres
Configure so that the vagrant user doesn't need to provide username and password.
apt-get -yqq install postgresql postgresql-contrib-9.3 libpq-dev postgresql-server-dev-9.3
su - postgres
createuser --createdb --superuser -Upostgres vagrant
psql -c "ALTER USER vagrant WITH PASSWORD 'password';"
psql -c "create database discourse_development owner vagrant encoding 'UTF8' TEMPLATE template0;"
psql -c "create database discourse_test owner vagrant encoding 'UTF8' TEMPLATE template0;"
View ruby and rvm
## Postgres
Configure so that the vagrant user doesn't need to provide username and password.
apt-get -yqq install postgresql postgresql-contrib-9.3 libpq-dev postgresql-server-dev-9.3
su - postgres
createuser --createdb --superuser -Upostgres vagrant
psql -c "ALTER USER vagrant WITH PASSWORD 'password';"
psql -c "create database discourse_development owner vagrant encoding 'UTF8' TEMPLATE template0;"
psql -c "create database discourse_test owner vagrant encoding 'UTF8' TEMPLATE template0;"
View ruby_and_rvm.md

RVM and Ruby

apt-get -yqq install libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config curl build-essential git

su - vagrant -c "sudo bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)"
adduser vagrant rvm
source /etc/profile.d/rvm.sh
su - vagrant -c "rvm pkg install libyaml"
su - vagrant -c "rvm install 2.0.0-turbo"
su - vagrant -c "rvm use 2.0.0-turbo --default"
@kamal-github
kamal-github / nginx-ssl-config
Created Feb 9, 2016 — forked from apollolm/nginx-ssl-config
Nginx Configuration with multiple port apps on same domain, with SSL.
View nginx-ssl-config
# the IP(s) on which your node server is running. I chose port 3000.
upstream app_geoforce {
server 127.0.0.1:3000;
}
upstream app_pcodes{
server 127.0.0.1:3001;
}
@kamal-github
kamal-github / nginxproxy.md
Created Feb 9, 2016 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?
View nginxproxy.md

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@kamal-github
kamal-github / jquery validate customization
Last active Mar 31, 2016
jquery validate plugin - different trick when customizing
View jquery validate customization
1) If you don't want to show error message -
`$('#form').validate({
errorPlacement: function(error,element) {
return true;
}
});`
`http://stackoverflow.com/questions/1578007/jquery-validate-hide-display-validation-error-messages-show-custom-errors`
You can’t perform that action at this time.