This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'active_record' | |
require 'json' | |
require 'net/http' | |
require 'uri' | |
ActiveRecord::Base.establish_connection( | |
:adapter => "postgresql", | |
:host => "localhost", | |
:username => "postgres", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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\$ ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
OlderNewer