Skip to content

Instantly share code, notes, and snippets.

View marcusvmsa's full-sized avatar
🎯
Focusing

Marcus Sá marcusvmsa

🎯
Focusing
  • Vakinha
  • Porto Alegre - Brazil
View GitHub Profile
@marcusvmsa
marcusvmsa / estados_brasileiros.erb
Created April 12, 2011 13:10
Lista de estados brasileiros para ActioView
<%= f.select :state, [ ["Acre", "AC"],
["Alagoas", "AL"],
["Amapá", "AP"],
["Amazonas", "AM"],
["Bahia", "BA"],
["Ceará", "CE"],
["Distrito Federal", "DF"],
["Espírito Santo", "ES"],
["Goiás", "GO"],
["Maranhão", "MA"],
vacuumdb --full --analyze --username postgres --dbname [DBNAME] --host [HOSTNAME]
pg_dump [DBNAME] -Ft -v -U postgres -f tmp/[DBNAME].tar --host [HOSTNAME]
dropdb [DBNAME] --username postgres --host [HOSTNAME]
createdb --encoding UTF8 [DBNAME] --username postgres --host [HOSTNAME] --template template0
pg_restore tmp/[DBNAME].tar | psql --dbname [DBNAME] --username postgres --host [HOSTNAME]
vacuumdb --full --analyze --username postgres --dbname [DBNAME] --host [HOSTNAME]
@marcusvmsa
marcusvmsa / .bashrc
Created April 4, 2011 11:29 — forked from dermidgen/.bashrc
.bashrg example
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
@marcusvmsa
marcusvmsa / gist:837043
Created February 21, 2011 13:19
Get local IP with Ruby
require "socket"
local_ip = UDPSocket.open {|s| s.connect("64.233.187.99", 1); s.addr.last}
@marcusvmsa
marcusvmsa / reset.css
Created December 7, 2010 17:31
Minimal CSS Reset
body{padding:0;margin:0;font:13px Arial,Helvetica,Garuda,sans-serif;*font-size:small;*font:x-small;}
h1,h2,h3,h4,h5,h6,ul,li,em,strong,pre,code{padding:0;margin:0;line-height:1em;font-size:100%;font-weight:normal;font-style: normal;}
table{font-size:inherit;font:100%;}
ul{list-style:none;}
img{border:0;}
p{margin:1em 0;}
gem list | cut -d" " -f1 | xargs gem uninstall -aIx