Skip to content

Instantly share code, notes, and snippets.

View bbcoimbra's full-sized avatar

Bruno Coimbra bbcoimbra

View GitHub Profile
function! RemoveTraillingSpaces()
let cursor_pos = getpos(".")
%s/[ \t]*$//g
call setpos(".", cursor_pos)
endfunction
au BufWrite *.rb :call RemoveTraillingSpaces()
@bbcoimbra
bbcoimbra / ux_referencias
Created September 13, 2012 05:09 — forked from eshiota/ux_referencias
UX para Developers - Referências
# UX para Developers - Referências
## Soluções prontas
- jQuery Mobile (http://www.jquerymobile.com)
- HTML 5 Boilerplate (http://html5boilerplate.com)
## Ferramentas
- Spin.js (http://fgnass.github.com/spin.js)
@bbcoimbra
bbcoimbra / gist:4134904
Created November 23, 2012 10:18
replace <li>text</li> by <li><%= link_to "text", "#" %></li>
s/\(<li>\)\([^<]\+\)\(<\/li>\)/\1<%= link_to "\2", "#" %>\3/

Debian-like init.d script for Unicorn

Actually I use the follow script to start/stop my unicorn rails processes. The script should be placed into /etc/init.d directory, in this case, the canonical name of file is /etc/init.d/unicorn.

Note: To this script work the variables below should be correctly set.

#!/bin/bash
# /etc/init.d/unicorn

Quick Steps to Configure Amazon AutoScaling

Setup Environment and Credentials

aptitude install openjdk-6-jre-headless
cat <<-ACCESS > <PATH_TO_CREDENTIAL_FILE>
AWSAccessKeyId=<YOUR_KEY_ID>

AWSSecretKey=

class APIConstraints
def initialize(options)
@version = options[:version]
@default = options[:default]
end
def matches?(request)
pt-BR:
devise:
confirmations:
confirmed: 'Sua conta foi confirmada com sucesso. Você está logado.'
send_instructions: 'Dentro de minutos você receberá um e-mail com instruções para confirmar a sua conta.'
send_paranoid_instructions: 'Caso seu e-mail exista em nossa base, você receberá um e-mail em poucos minutos com instruções sobre como confirmar sua conta.'
failure:
already_authenticated: 'Você já está logado.'
inactive: 'A sua conta não foi ativada ainda.'
invalid: 'E-mail e senha inválidos'
@bbcoimbra
bbcoimbra / backup_to_s3.sh
Created August 9, 2017 19:43
Database backup to S3 with pg_dump and aws-cli
#!/bin/bash
#
# Author: Bruno Coimbra <bbcoimbra@gmail.com>
#
# Backups database located in DB_HOST, DB_PORT, DB_NAME
# and can be accessed using DB_USER. Password should be
# located in $HOME/.pgpass and this file should be
# chmod 0600[1].
#
# Target bucket should be set in BACKUP_BUCKET variable.

Keybase proof

I hereby claim:

  • I am bbcoimbra on github.
  • I am bbcoimbra (https://keybase.io/bbcoimbra) on keybase.
  • I have a public key ASC-GB9llD8W-PxaKd8Z7s523TaEM24vN3hKN0uSAqGFvgo

To claim this, I am signing this object:

#!/bin/sh
set -e
### UserVariables
aws_key_id="$1"
aws_key_secret="$2"
dbinstance="$3"
### InternalVariables
aws_host="amazonaws.com"