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 / 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_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 / rails_migration_cheatsheet.md
Created June 18, 2012 21:40
Rails Migration - Cheatsheet
@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 / aliases.sh
Last active October 6, 2015 03:47
aliases
# bash
alias b='vi ~/.bash_login'
alias u='source ~/.bashrc'
#ls
alias l='ls -CF'
alias ll='ls -alFc'
alias la='ls -A'
alias lt='ls -lart'
@amejiarosario
amejiarosario / two-line-prompt.sh
Created June 14, 2012 13:29
2 lines prompt, git branch and time
# A two-line colored Bash prompt (PS1) with Git branch and a line decoration
# which adjusts automatically to the width of the terminal.
# Screenshot: http://img194.imageshack.us/img194/2154/twolineprompt.png
# Michal Kottman, 2012
RESET="\[\033[0m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"
YELLOW="\[\033[0;33m\]"

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@amejiarosario
amejiarosario / rbenv-install.sh
Created May 22, 2012 13:56 — forked from dillera/rbenv-lucid
rbenv for ubuntu
#!/bin/bash
set -e # exit on error
### README
# * installs your desired ruby versions using rbenv
# ** including openssl (needed by bundler)
# ** including sqlite (probably needed for rails apps)
#
# Before you start:
# * put ssh-keys in place
@amejiarosario
amejiarosario / prompts.sh
Created May 16, 2012 14:56
bash prompts
amejia@DEVCOOPPC-W7 /C/amr/tickets/ticket_2109_SQR_OK_TO_RELEASE (master)
$ echo $PS1
\[\033]0;$MSYSTEM:\w\007 \033[32m\]\u@\h \[\033[33m\w$(__git_ps1)\033[0m\] $
@amejiarosario
amejiarosario / drupal2jekyll.rb
Created April 28, 2012 02:46
Jekyll migrator for Drupal 7+
#
# Jekyll migrator for Drupal 7+
# adrianmejia.com
#
require 'rubygems'
require 'sequel'
require 'fileutils'
require 'yaml'