Skip to content

Instantly share code, notes, and snippets.

View roberto's full-sized avatar
🍊

Roberto Soares roberto

🍊
View GitHub Profile
@roberto
roberto / gist:6580341
Created September 16, 2013 12:56
fizzbuzz
numero = gets
fizzbuzz(10)
# 1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz 13 14 fizzbuzz
# imprimir todos os números até o número
# se for divisível por 3, imprime fizz
# se for divisível por 5, imprime buzz
# caso não, imprime o próprio número
@roberto
roberto / gist:6157458
Last active December 20, 2015 15:49
downloader
package main
import (
"bufio"
"fmt"
"io/ioutil"
"net/http"
"os"
"regexp"
)
package main
import (
"fmt"
"time"
)
type Client struct {
name string
@roberto
roberto / str.go
Created July 30, 2013 22:10 — forked from fsouza/str.go
package str
func Reverse(input string) string {
return ""
}
@roberto
roberto / gist:5940958
Last active December 19, 2015 10:29
Centering Percentage Width/Height Elements
/*
* http://css-tricks.com/centering-percentage-widthheight-elements/
*/
.center {
position: absolute;
left: 50%;
top: 50%;
/*
@roberto
roberto / custom.sass
Created May 28, 2013 16:20
all_about_you config example
$background-image: none
$background-color: black
$box-color: #EEE
$box-border-rounded: true
$name-color: black
$name-size: 47px
$name-font: Raleway
@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
@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 / 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