Skip to content

Instantly share code, notes, and snippets.

View roberto's full-sized avatar
🍊

Roberto Soares roberto

🍊
View GitHub Profile
@roberto
roberto / gist:3230002
Created August 1, 2012 19:38
Octopress: Updating GitHub repos list to use GitHub Api v3

It has been fixed in the brach "2.1", so I cherry-picked the commmits into my fork's master (version 2).


git fetch octopress

git cherry-pick 693fc29572fe2fcd3c8dc546d29fb48dc8300833

git cherry-pick b69e876828510c583fa74f6b52641ae8f0d733b6
@roberto
roberto / gist:3278455
Last active October 8, 2015 04:38
Gist.IO Page Switcher
@roberto
roberto / _flash_messages.html.erb
Created August 13, 2012 22:47
Rails flash messages using Twitter Bootstrap
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
</div>
<% end %>
@roberto
roberto / id_rsa.pub
Created August 26, 2012 14:58
my public key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwow3GboXCypiXsTAIxUK6XJO9lO2VtAAandEvO6mlGIDSoEU3n9Un1aZpgKkAOB6ABjiivEFKf8nBjjeRV1Cfc1Y1BkXoeO81XYkhOKEhR57TzbukD/hzgOCkslktYO9JM+O/Sct7QEAVTaQSVyoaSEbBSQvP82tUGoa1c4DCKYt5K5+zZfQzMJ003rckQqIiKHKayu01x+Y1XVPYcpiOt1SYk4CPOf0iSn2FSCG/V4d8VkdHbxGlyIgyXk65wr326UhAg+NV7rD/tGrhbQzWBx4N0I//Dop0Cb1DO/OhtQtkEQGU1kV3H9gl/ZyO3IbK6i5mcTo/7hUkc67o3eplQ== roberto@roberto-soaress-macbook.local
@roberto
roberto / gist:4027929
Created November 6, 2012 22:07
Meet Chef Part 1
# file: nginx/attributes/nginx.rb
default.nginx.dir = "/etc/nginx"
# file: rails/recipes/default.rb
directory common[:app_root] do
owner "vagrant"
recursive true # <<-- add this line
end
@roberto
roberto / application_controller.rb
Created November 16, 2012 23:52
Rspec: Anonymous controller
class ApplicationController < ActionController::Base
protect_from_forgery
rescue_from ActiveRecord::RecordNotFound, :with => :not_found
private
def not_found
respond_to do |format|
format.html { render file: "#{Rails.root}/public/404", status: 404, layout: false}
end
true
@roberto
roberto / .bash_profile
Created December 9, 2012 01:44
passing changed files as arguments to your default editor
export EDITOR='mvim -p'
function keepcoding {
git status --porcelain --ignore-submodules | awk '$1 != "D" { print $2}' | xargs $EDITOR
}
@roberto
roberto / _config.yml
Last active December 16, 2015 22:09
i18n octopress suggestion
title: Blah blah
text:
<<: *pt-BR
pt-BR: &pt-BR
recent_projects: Projetos Recentes
recent_posts: Últimos artigos
en-US: &en-US