Skip to content

Instantly share code, notes, and snippets.

View tiagogodinho's full-sized avatar

Tiago Godinho tiagogodinho

  • São Paulo - SP - Brasil
View GitHub Profile
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NO_COLOUR="\[\033[0m\]"
PS1="\w$RED\$(parse_git_branch)$NO_COLOUR \$ "
# Alternativa 1
projects = Project.all
puts Professional.where(professional_type: 'architect', published: 'true').display_as_architect.also_in(project_ids: projects.collect(&:id)).asc(:name).collect(&:name).count
# Alternativa 2
projects = Project.all
puts projects.collect { |project| project.architects.collect(&:name) }.flatten.uniq.sort { |x, y| x.downcase <=> y.downcase }.count
require 'benchmark'
@tiagogodinho
tiagogodinho / README.md
Created March 21, 2012 23:10
MediaMagick

MediaMagick

TODO: Write a gem description

Installation

Add this line to your application's Gemfile:

gem 'media_magick'