Skip to content

Instantly share code, notes, and snippets.

View amejiarosario's full-sized avatar
🎯
Think big, start small, learn fast!

Adrian Mejia amejiarosario

🎯
Think big, start small, learn fast!
View GitHub Profile
@amejiarosario
amejiarosario / .gitconfig
Created June 14, 2012 17:19
Git config
[user]
email = [email protected]
name = Adrian Mejia
[color]
ui = auto
interactive = true
[alias]
ci = commit
di = diff --color-words
@amejiarosario
amejiarosario / rails_migration_cheatsheet.md
Created June 18, 2012 21:40
Rails Migration - Cheatsheet
@amejiarosario
amejiarosario / rails_activerecord_cheatsheet.md
Created June 18, 2012 22:18
Rails ActiveRecord (association) - Cheatsheet

Rails ActiveRecord (association) - Cheatsheet

http://guides.rubyonrails.org/association_basics.html

Types of associations

  • belongs_to : TABLE_NAME
  • has_one : TABLE_NAME [:through => :TABLE_NAME]
  • has_many : TABLE_NAME [:through => :TABLE_NAME]
  • has_and_belongs_to_many : TABLE_NAME [:join_table => :TABLE_NAME]
@amejiarosario
amejiarosario / vagrant.md
Created June 21, 2012 02:36
Vagrant - Virtual Development Enviroment

Vagrant

Virtualized development http://vagrantup.com/

Setup

 $ gem install vagrant
 $ mkdir vagrant-box && cd vagrant-box # (optional)
 $ vagrant box add {title} {url}
 $ vagrant init {title}
@amejiarosario
amejiarosario / rails_setup.sh
Created June 21, 2012 03:08
Ubuntu and Rails
# Getting Up To Date
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
#reboot your system $ sudo reboot
# Some required programs
sudo apt-get -y install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev ctags vim libreadline-dev libyaml-dev libcurl4-openssl-dev subversion
@amejiarosario
amejiarosario / rbenv.sh
Created June 21, 2012 04:17
rbenv setup
# Ruby Enviroment (rbenv)[https://github.com/sstephenson/rbenv] (installer) [https://github.com/fesplugas/rbenv-installer]
curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
## Install Ruby
rbenv install 1.9.3-p194
rbenv install 1.9.2-p320
rbenv global 1.9.2-p320
@amejiarosario
amejiarosario / dotfiles_installer.sh
Last active October 6, 2015 10:07
Dotfile installer - Let's automate the boring process for awesome results
# curl -k https://gist.github.com/raw/2976697/a2e9f2ff292a1fe5ceb7ddb05900f73a249abcdb/dotfiles_installer.sh | sudo sh
# create directory
cd ~/
mkdir gists
cd gists
# download git stuff
git clone git://gist.github.com/2931603.git gitconfig
ln -s ~/gists/gitconfig/.gitconfig ~/.gitconfig
@amejiarosario
amejiarosario / capybara cheat sheet
Created July 18, 2012 15:10 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@amejiarosario
amejiarosario / elastic_search_tire.rb
Created November 15, 2012 16:41
elastic search cheatsheet
# ~/elasticsearch-0.19.11/bin/elasticsearch -f
#
# Include to and active record model
#
class Log < ActiveRecord::Base
include Tire::Model::Search
include Tire::Model::Callbacks
end
@amejiarosario
amejiarosario / redis_es_ls.md
Last active December 14, 2015 02:48 — forked from garlandkr/redis_es_ls.md
new elasticsearch version (elasticsearch-0.20.5)

This will be a copy/paste doc for installing redis, elasticsearch and logstash on ubuntu 12.04

Pre-Requisites

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install tcl8.5 tcl8.5-dev build-essential rubygems git \
htop python-dev openjdk-7-jre-headless libcurl4-openssl-dev \
bison ctags flex gperf libevent-dev libpcre3-dev libssl-dev libreadline6-dev \
libtokyocabinet-dev libncursesw5-dev libxml2-dev libxslt1-dev libsqlite3-dev \