Skip to content

Instantly share code, notes, and snippets.

View monkseal's full-sized avatar

Kevin English monkseal

  • Kenglish.co - Ruby, React.js, Javascript Developer
  • South Lake Tahoe/San Diego/Honolulu
View GitHub Profile
@monkseal
monkseal / .rubocop.yml
Created April 22, 2015 15:42
My standard .rubocop.yml
inherit_from: .rubocop_todo.yml
AllCops:
Exclude:
- db/schema.rb
- db/migrate/*
- bin/*
RunRailsCops: true
Documentation:
#!/bin/sh
echo "Running pre-commit hook, to run with out do 'git commit -n'"
bin/rake ci:rubocop_changed
@monkseal
monkseal / commit-msg
Last active August 29, 2015 14:20
Simple 'commit-msg' hook to reject commits that don't contain the issue number
#!/bin/sh
#
# This example tests that the commit message contains DS, exit 1 will fail the commit.
test "" != "$(grep '\[DS-[0-9]\+\]' "$1")" || {
echo >&2 "ERROR: Commit message is missing Jira issue number."
exit 1
}
@monkseal
monkseal / deploy.rb
Created May 8, 2015 00:43
Invoke a rake task from capistrano 3
namespace :deploy do
# ....
# @example
# bundle exec cap uat deploy:invoke task=users:update_defaults
desc 'Invoke rake task on the server'
task :invoke do
fail 'no task provided' unless ENV['task']
on roles(:app) do
within release_path do
@monkseal
monkseal / provision.sh
Created June 3, 2015 23:50
Ruby on Rails Centos 6.6 provision.sh
#!/bin/bash
# Install dependent packages
sudo yum update
sudo yum install -y apr-devel apr-util-devel autoconf automake curl-devel \
g++ gcc gcc-c++ git glibc-headers httpd-devel libxml2 \
libxml2-devl libxslt libxslt-devel libyaml-devel make \
mysql-devel mysql-server openssl-devel patch readline \
readline-devel zlib zlib-devel
@monkseal
monkseal / Vagrantfile
Last active August 29, 2015 14:22
Vagrantfile for Centos 6.6
# Host => Guest (VM)
FORWARD_PORTS = {
3000 => 3000, # webrick
13_306 => 3306 # MySQL
}
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
@monkseal
monkseal / database.yml
Created June 10, 2015 15:55
database.yml for connecting to centos
default: &default
adapter: mysql2
encoding: utf8
reconnect: false
pool: 5
port: 13306
username: blog_user
password: blog_user91x91x
host: localhost
@monkseal
monkseal / provision.sh
Created June 10, 2015 17:10
Provision script for CentOS 6 with Ruby and Postgres 9.4
#!/bin/bash
echo "Installing package dependencies"
sudo yum update
sudo yum install -y apr-devel apr-util-devel autoconf automake curl-devel \
g++ gcc gcc-c++ git glibc-headers httpd-devel libxml2 \
libxml2-devl libxslt libxslt-devel libyaml-devel make \
openssl-devel patch readline \
readline-devel zlib zlib-devel
@monkseal
monkseal / Vagrantfile
Created June 10, 2015 17:13
Vagrantfile for Centos 6.6 with Postgres Port mapped
# Host => Guest (VM)
FORWARD_PORTS = {
3030 => 3030, # webrick
15_432 => 5432 # PostgreSQL
}
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
@monkseal
monkseal / database.yml
Created June 10, 2015 17:19
Modified database.yml with different postgres port
default: &default
adapter: postgresql
encoding: utf8
min_messages: warning
port: 15432
pool: 5
username: blog_user
password: blog_user91x91x
host: 127.0.0.1