Skip to content

Instantly share code, notes, and snippets.

require 'rubygems'
require 'active_record'
require 'json'
require 'net/http'
require 'uri'
ActiveRecord::Base.establish_connection(
:adapter => "postgresql",
:host => "localhost",
:username => "postgres",
# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the PostgreSQL
# documentation for a complete description of this file. A short
# synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms:
@vagnerzampieri
vagnerzampieri / gist:3094893
Created July 12, 2012 01:00
git lg sinistro da Anna Cruz
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
@vagnerzampieri
vagnerzampieri / .bashrc_profile
Last active October 7, 2015 03:07
Prompt com saída melhorada
export PS1='\[\e[01;30m\]\t `if [ $? = 0 ]; then echo "\[\e[32m\]✔"; else echo "\[\e[31m\]✘"; fi` \[\e[0;35m\]`~/.rvm/bin/rvm-prompt` \[\e[00;37m\]\u@\h\[\e[01;37m\] : `[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "\[\e[31m\]" || echo "\[\e[32m\]"`$(__git_ps1 "(%s)\[\e[00m\]")\[\e[01;34m\]\w\[\e[00m\] \n\$ '
@vagnerzampieri
vagnerzampieri / gist:3993117
Created November 1, 2012 11:23 — forked from annacruz/gist:3738510
sublime text ppa over proxy
add the http_proxy and https_proxy to .bashrc
export http_proxy='user:pass@proxy'
export https_proxy='user:pass@proxy'
sudo visudo
then add the following lines
Defaults env_keep="http_proxy"
Defaults env_keep="https_proxy"
%h3
= t("headers.employee.identification")
%actions
= link_to image_tag('edit.png'), edit_employee_tab_path(@employee, :documents), remote: true, title: t(:'actions.edit')
%dl
= data_item @employee, :id_number
.photo{id: 'rg', style: "display:none;"}= link_img_id_attachment if @employee.id_attachment_url
%br
= data_item @employee, :id_issuing_agency
json.patients @patients do |patient|
json.id patient.id
json.name patient.name
json.anamnese patient.anamnese.id
json.cpf patient.cpf
json.cep patient.cep
json.address patient.address
json.number patient.number
json.complement patient.complement
json.neighborhood patient.neighborhood
@vagnerzampieri
vagnerzampieri / .bash_aliases
Last active October 25, 2017 20:18
Alias público, se tiver coisas interessantes, contribua.
function mkcd(){
mkdir $1;
cd $1;
}
# Apt
alias apti='sudo apt-get install'
alias apts='sudo apt-cache search'
alias aptp='sudo apt-get --purge remove'
alias aptr='sudo apt-get remove'
@vagnerzampieri
vagnerzampieri / gist:4685570
Last active December 12, 2015 00:39
install postgresql
Install PostgreSQL:
sudo apt-get install postgresql-9.1 postgresql-server-dev-9.1 postgresql-contrib-9.1 postgresql-client-9.1 postgresql-common libpq-dev
Check postgresql:
sudo -u postgres psql
Install pgadminIII
sudo apt-get install pgadmin3
@vagnerzampieri
vagnerzampieri / gist:5040937
Last active December 14, 2015 06:09
instalação da máquina
Alias:
Criei um ~/.bash_aliases que será carregado no ~/.bashrc do usuário logado,
ele vai carregar aliases úteis para utilização, depois que colocar os
alias(https://gist.github.com/4492613) é só carregar o bashrc com
um 'source ~/.bashrc'
Saída do Bash melhorada:
Deve ser colocado em ~/.bashrc o código(https://gist.github.com/3094935)
e depois carregar o bashrc com um 'source ~/.bashrc'