Skip to content

Instantly share code, notes, and snippets.

View brennovich's full-sized avatar
👋
Hey, there

Brenno Costa brennovich

👋
Hey, there
View GitHub Profile
@brennovich
brennovich / devise.pt-BR.yml
Created January 8, 2012 22:43 — forked from mateusg/devise.pt-BR.yml
pt-BR translations for Devise
# encoding: UTF-8
# pt-BR translations for Devise
pt-BR:
errors:
messages:
not_found: "não encontrado"
already_confirmed: "já foi confirmado"
not_locked: "não foi bloqueado"
not_saved:
one: "Não foi possível salvar %{resource}: 1 erro"
@brennovich
brennovich / pt-BR.yml
Created January 8, 2012 22:47
Rails pt-BR locale
# encoding: UTF-8
# pt-BR translations for Ruby on Rails
"pt-BR":
# formatos de data e hora
date:
formats:
default: "%d/%m/%Y"
short: "%d de %B"
long: "%d de %B de %Y"
@brennovich
brennovich / gist:1584937
Created January 9, 2012 21:04
Enable text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool TRUE; killall Finder
@brennovich
brennovich / chess.rb
Created January 12, 2012 01:10
Chess Class, with Knight valid moves
class Chess
def self.board
board = []
('a'..'h').map do |w|
line = []
('1'..'8').each do |h|
line.push w + h
end
board.push line
end
@brennovich
brennovich / gist:1692262
Created January 28, 2012 02:56
Criar Remote git repo
#!/bin/bash
# Author: Brenno Costa
[email protected]
function echo_ssh_in_authorized_keys()
{
cat ~/.ssh/id_rsa.pub | ssh [email protected] 'cat >> ~/.ssh/authorized_keys'
}
@brennovich
brennovich / etc_init.d_unicorn_example.co.uk
Created February 5, 2012 14:06 — forked from scottlowe/etc_init.d_unicorn_example.co.uk
Ruby on Rails server setup on Ubuntu 11.04 with Nginx, Unicorn, Rbenv
#! /bin/bash
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the unicorn web server
# Description: starts unicorn
@brennovich
brennovich / gist:1746374
Created February 5, 2012 16:27
ubuntu gem dependencies
sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
@brennovich
brennovich / gist:1937833
Created February 29, 2012 04:46
My ZSH conf
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="gallois"
# Example aliases
@brennovich
brennovich / gist:1937948
Created February 29, 2012 04:59
Postgresql + 10.7 + Brew

Brew command:

brew install postgresql

follow LaunchAgents instructions, and run this:

initdb -E utf8 -D /usr/local/var/postgres

if you have any problem with shared memory: just **restart**

class PostsController < ActionController::Base
def create
Post.create(post_params)
end
def update
Post.find(params[:id]).update_attributes!(post_params)
end
private