Skip to content

Instantly share code, notes, and snippets.

View mateusg's full-sized avatar

Mateus Gomes mateusg

View GitHub Profile
@mateusg
mateusg / devise.pt-BR.yml
Last active December 23, 2023 15:15 — forked from alexandreaquiles/devise.pt-BR.yml
pt-BR translations for Devise
# encoding: UTF-8
# pt-BR translations for Devise
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 a confirmação da sua conta."
send_paranoid_instructions: "Se o seu endereço de e-mail estiver cadastrado, você receberá uma mensagem com instruções para confirmação da sua conta."
failure:
already_authenticated: "Você já está logado."
@mateusg
mateusg / pt-BR.yml
Last active August 14, 2016 13:42
pt-BR translations for Ruby on Rails
# encoding: UTF-8
# pt-BR translations for Ruby on Rails
"pt-BR":
date:
abbr_day_names:
- Dom
- Seg
- Ter
- Qua
- Qui
@mateusg
mateusg / inflections.rb
Created April 17, 2011 23:03
pt-BR inflections file for Ruby on Rails applications
# encoding: utf-8
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
@mateusg
mateusg / script_column_search.sql
Created April 17, 2011 23:12
MySQL query to search for columns by name in a database
-- MySQL Query
-- Search all tables from a database for columns that the name matches 'user_id'.
SELECT table_name, column_name FROM information_schema.columns
WHERE table_schema = 'database_name' AND column_name LIKE '%user_id%';
@mateusg
mateusg / 1ntro.markdown
Created December 24, 2011 19:32 — forked from douglasmiranda/1ntro.markdown
Django + git + apache mod_wsgi na Kinghost

#Django + git + apache mod_wsgi na Kinghost

Apenas um lembrete para mim. Mas é legal compartilhar e ter a condição de melhorar com os comentários da galera :)

##Início

Talvez você não queira ficar digitando a senha toda vez que usar o ssh, então adicione sua chave pública ao seu host:

No servidor:

@mateusg
mateusg / ubuntu_nginx_rails_passenger
Created July 16, 2012 21:07
Ubuntu + Nginx + Passenger + Rails 3 setup
rails-nginx-passenger-ubuntu
============================
COPIED FROM: https://github.com/jnstq/rails-nginx-passenger-ubuntu
My notes on setting up a simple production server with ubuntu, nginx, passenger and mysql for rails.
Aliases
-------
@mateusg
mateusg / Preferences.sublime-settings
Created July 18, 2012 18:35
Sublime User preferences
// Settings in here override those in "Default/Preferences.sublime-settings", and
// are overridden in turn by file type specific settings.
{
"color_scheme": "Packages/Railscasts.tmTheme",
"font_face": "Monaco",
"font_size": 12.0,
"tab_size": 2,
//"translate_tabs_to_spaces": true,
"indent_to_bracket": true,
"highlight_line": true,
@mateusg
mateusg / ensite.sh
Created August 3, 2012 21:22
Script for enabling a site, just like a2ensite, from Apache2.
#! bin/bash
# Enables a site, just like a2ensite command, from Apache2.
SITES_AVAILABLE_CONFIG_DIR="/opt/nginx/sites-available";
SITES_ENABLED_CONFIG_DIR="/opt/nginx/sites-enabled";
if [ $1 ]; then
if [ -f "${SITES_ENABLED_CONFIG_DIR}/${1}" ]; then
echo "Site ${1} was already enabled!";
elif [ ! -w $SITES_ENABLED_CONFIG_DIR ]; then
@mateusg
mateusg / dissite.sh
Created August 3, 2012 21:29
Script for disabling a site, just like a2dissite, from Apache2
#! /bin/bash
# Disables a site, just like a2dissite command, from Apache2.
SITES_AVAILABLE_CONFIG_DIR="/opt/nginx/sites-available";
SITES_ENABLED_CONFIG_DIR="/opt/nginx/sites-enabled";
if [ $1 ]; then
if [ ! -f "${SITES_ENABLED_CONFIG_DIR}/${1}" ]; then
echo "Site ${1} was already disabled!"
elif [ ! -w $SITES_ENABLED_CONFIG_DIR ]; then
@mateusg
mateusg / paperclip_file_input.rb
Created December 7, 2012 17:15
Paperclip input for Simple Form
class PaperclipFileInput < SimpleForm::Inputs::FileInput
def input
value = object.persisted? && object.reload.send(attribute_name)
current_image_tag = if value.present? && value.content_type =~ /image/
template.image_tag(value.url, :alt => "#{attribute_name}_image")
else
""
end