Skip to content

Instantly share code, notes, and snippets.

View luizpicolo's full-sized avatar
👨‍🏫
Teaching

Luiz F. Picolo luizpicolo

👨‍🏫
Teaching
View GitHub Profile
@emad-elsaid
emad-elsaid / gravatar.rb
Created March 7, 2014 13:07
Gravatar image url generator simple method Gravatar image url generator simple method
#!/usr/bin/env ruby
require 'digest/md5'
require "addressable/uri"
# this is based on gravatar image API
# https://en.gravatar.com/site/implement/images/
# options :
# size : <integer> size of image
# default: <string> url of image if email not found or:
# * 404
@victorlcampos
victorlcampos / Aplicativos
Last active December 18, 2015 23:49
Conteúdo gerado por membros do Grupo "Ruby on Rails Brasil"
== InfoDic FREE
https://play.google.com/store/apps/details?id=br.walisson.inglesparainformaticafree#?t=W251bGwsMSwxLDIxMiwiYnIud2FsaXNzb24uaW5nbGVzcGFyYWluZm9ybWF0aWNhZnJlZSJd
@luizpicolo
luizpicolo / install.sh
Last active September 7, 2016 15:02
Auto Installer
#!/bin/bash
# install zsh
rm -fr .oh-my-zsh/
curl -L http://install.ohmyz.sh > install.sh
sh install.sh
# add final .zshrc
echo 'source ~/.bash_aliases' >> ~/.zshrc
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> >> ~/.zshrc
@luizpicolo
luizpicolo / install_server.sh
Last active April 8, 2017 22:26
Install Server
# Configure Timezone
dpkg-reconfigure tzdata
# Configure locale
locale-gen pt_BR pt_BR.UTF-8
locale-gen en_US en_US.UTF-8
# Instalar Postgree e trocar senha
sudo apt-get install postgresql postgresql-contrib
psql -c "ALTER USER postgres WITH PASSWORD 'nova_senha'" -d template1
@ericoporto
ericoporto / ywcc_ptbr.py
Created July 28, 2015 00:39
Yahoo Weather API Condition Codes in Brazilian Portuguese (Códigos do Yahoo Weather em Português - Brasil)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Erico Vieira Porto
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@taq
taq / gist:1ef38725c39c041f59701f29a83c7fa3
Created October 11, 2016 22:28
Git alias to create a new remote branch based on the current branch
Just insert on .gitconfig:
nrb = "!f() { git push -u origin $(git rev-parse --abbrev-ref HEAD):$1; }; f"
And then, when on a local branch and want to push to a new remote branch called, say, 'test':
$ git nbr test
Total 0 (delta 0), reused 0 (delta 0)
To <your remote here>
* [new branch] work -> test
@Overbryd
Overbryd / rails_admin_and_globalize3.md
Created July 14, 2011 20:31
RailsAdmin and Globalize3

RailsAdmin and Globalize3

I have a project where I need translated content. Therefore I use globalize3, wich stores its translated attributes in a seperate table that belongs to the original model. And I use RailsAdmin for painless record management.

It took me some time to figure out how to get those working together, but eventually I found a solution that is non invasive and still ok to work with.

The translated model

In my case there is a Snippet class. It holds content for static pages or text passages on the website. There is a good README for globalize3 for installation instructions and documentation.

@samuelpismel
samuelpismel / kaminari.pt-BR.yml
Last active March 12, 2020 14:21
Tradução do gem kaminari 0.14.1 para português brasileiro (pt-BR)
#encoding: utf-8
pt-BR:
views:
pagination:
first: "&laquo; Primeira"
last: "Última &raquo;"
previous: "&lsaquo; Anterior"
next: "Próxima &rsaquo;"
truncate: "&hellip;"
@daltonjorge
daltonjorge / rails_annotations.md
Created August 8, 2012 14:42 — forked from hakagura/rails_annotations.md
Explicações de conceitos do Rails e outras infos úteis.

Active Record

É um design pattern que o Rails implementa a partir da gem ActiveRecord.

Serve para conectar a camada Model da aplicação com tabelas do database, para assim criar um modelo de domínio persistível, onde a lógica (Model) e dados (BD) são apresentados em uma única solução.

Já persiste no BD:

obj.create