Skip to content

Instantly share code, notes, and snippets.

@rogerleite
rogerleite / .bashrc
Created Dec 23, 2009
Shows git branch at prompt
View .bashrc
#On Ubuntu, put this in the end of ~/.bashrc file
# Displays the current git branch name and the dirty state in your Bash shell
# prompt. Add a line like this to your ~/.bashrc file:
#
# . ~/path/to/gist/bash-git-prompt
#
# To use this, you must enable "enable programmable completion features".
# Look at your ~/.bashrc for something like:
#
View .irbrc
# This irb script enables:
# - irb completion. (Ex: "".[tab] show available methods)
# - commands history. Up and Down arrows to navigate at commands.
# - requires pretty print.
# - if "awesome print" gem is available, replace pp command for ap.
# - if RAILS_ENV exists, set irb console as logger. (I can see queries from ActiveRecord)
require 'irb/completion'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
View cucumber.rake
begin
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:cucumber) do |t|
t.cucumber_opts = "features --format pretty"
end
namespace :cucumber do
Cucumber::Rake::Task.new(:wip) do |t|
t.cucumber_opts = "features --format pretty -t @wip --wip"
View db_utility_belt.rake
# Database Utils for lazy programmers
namespace :db do
# Simple Mysql Dump Operations
namespace :dump do
def param_filename
filename = ENV["file"] || "db/dump/#{db[:database]}.sql"
filename = "#{Rails.root}/#{filename}" unless filename.starts_with?("/")
filename
@rogerleite
rogerleite / myvimrc
Created Jan 28, 2011
My .vimrc file
View myvimrc
"https://github.com/akitaonrails/vimfiles
"git://github.com/akitaonrails/vimfiles.git
source ~/.vim/vimrc
nnoremap <C-b> :BufExplorer<cr>
nnoremap <C-f> :CommandT<CR>
"disable visual bell for all platforms
if has("autocmd") && has("gui")
View rake test output 3.0.4
(in /home/roger/dev/trivial/temp/raketest)
** Invoke test (first_time)
** Execute test
** Invoke test:units (first_time)
** Invoke test:prepare (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
ENV LOADED !
@rogerleite
rogerleite / .gitconfig
Created Nov 11, 2011
my .gitconfig file
View .gitconfig
[url "ssh://git-abril/repos/"]
insteadOf = abril-repo:
[user]
name = Roger Leite
email = roger.barreto+github@gmail.com
[core]
editor = gvim -f
[color]
diff = auto
interactive = auto
@rogerleite
rogerleite / .bash_profile
Created Feb 1, 2012
Bash profile do Mac da Abril
View .bash_profile
alias ls='ls -G'
# brew install bash-completion
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
# Tell grep to highlight matches
export GREP_OPTIONS='--color=auto'
@rogerleite
rogerleite / dibot.rb
Created Feb 17, 2012
Robo xexelento que executa comando
View dibot.rb
require 'rubygems'
require 'xmpp4r-simple'
# gem install xmpp4r-simple
include Jabber
#Jabber::debug = true
jid = 'email@gmail.com'
pass = 'secret'
@rogerleite
rogerleite / postinstall.sh
Created Mar 21, 2012 — forked from evansd/postinstall.sh
postinstall sript from vagrant example box (having it somewhere web-accessible is easiest way to get it on to newly created VMs)
View postinstall.sh
#!/usr/bin/env bash
# Apt-install various things necessary for Ruby, guest additions,
# etc., and remove optional things to trim down the machine.
apt_get_things()
{
apt-get -y update
apt-get -y remove apparmor
apt-get -y install linux-headers-$(uname -r) build-essential
apt-get -y install zlib1g zlib1g-dev libxml2 libxml2-dev libxslt-dev libssl-dev openssl libreadline5-dev