Skip to content

Instantly share code, notes, and snippets.

Lareb Nawab lareb

Block or report user

Report or block lareb

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
@lareb
lareb / Instructions.md
Created Jul 17, 2017 — forked from pgilad/Instructions.md
Git commit-msg hook to validate for jira issue or the word merge
View Instructions.md

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example

@lareb
lareb / jenkins.md
Created Jun 9, 2017 — forked from wagnerjgoncalves/jenkins.md
Shell Script to install Jenkins at Ubuntu
View jenkins.md
@lareb
lareb / install.sh
Created May 26, 2017 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
View install.sh
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
View Rails 4 - how to give alias names to includes() and joins() in active record quering
See question on stack overflow: http://stackoverflow.com/questions/28595636/rails-4-how-to-give-alias-names-to-includes-and-joins-in-active-record-que
- Model Student and model Teacher are both STI models with super class model User
- Model Story is a STI model with super class model Task
- includes() and joins(), both fails
Rails alias naming convention (includes() and joins())
- One model as parameter
- is base model (includes(:users))
@lareb
lareb / install_passenger_nginx_digital_ocean.sh
Created Nov 9, 2016 — forked from sathishmanohar/install_passenger_nginx_digital_ocean.sh
Steps to setup and install passenger nginx and rails on digital ocean
View install_passenger_nginx_digital_ocean.sh
# Login as root
ssh root@domain
# Create deploy user
adduser <username> #Adds User with username given. Enter Password when Prompted. Other Details are Optional
# Add user to sudo group
usermod -g <groupname> <username>
# Add .ssh/authorized_keys for deploy user
View custom validation
class MyController
include One
def create
params = {first_name: "lareb", last_name: "nawab", email: "lareb.indore@gmail.com",
mobile: "8087036184", address_line_1: "2171 Parmar nagar 5", address_line_2: "Fatima Nagar",
city: "Pune", state: "Maharashtra", country: "India", zip: "411013"}
#this will return an array of validation message
validate(params)
You can’t perform that action at this time.