Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View halan's full-sized avatar
🛹

Halan Pinheiro halan

🛹
View GitHub Profile
@halan
halan / SassMeister-input-HTML.html
Created March 14, 2014 20:12
Generated by SassMeister.com.
<h1>Foo</h1>
<h2>bar</h2>
<h3>foobar</h3>
<div>
<h1>Foo</h1>
<h2>bar</h2>
<h3>foobar</h3>
</div>
1. Two space soft indents (fake tabs) OR tabs... BUT NEVER BOTH - DO NOT MIX
2. Whitespace, Parens, Braces, Linebreaks
if/else/for/while/try always have spaces, braces and multiple lines.
--------------------------------------------------------------------
define 'components/singleton', [], ->
###
Singleton class
###
class Singleton extends Backbone.View
# @static
@getInstance = ->
@_instance = new @ unless @_instance?
@_instance
pt-BR:
ie6update:
msg: 'O seu Internet Explorer tá precisando ser atualizado pra poder visualizar esse site. Clique aqui pra atualizar... '
url: 'http://www.microsoft.com/windows/internet-explorer/default.aspx'
home:
index:
headline1: "EchoWaves.com é um grupo de chat social opensource"
headline2: 'O código fonte está hospedado em: <a href="http://github.com/dmitryame/echowaves">http://github.com/dmitryame/echowaves</a>.'
p1: "<h5>Se você gosta de conversar, participar de blogs, enviar fotos, compartilhar atualizações com seus amigos, ou simplesmente socializar -- Você vai adorar o EchoWaves.</h5> Se você tem algumas ideias ou sugestões sinta-se livre para falar sobre isso aqui"
p2: "-- É de graça e qualquer um pode entrar. Inicie seus próprios convos, convide todos os seus amigos para entrar nos seus convos, siga outros convos que pareçam interessante para você. Divirta-se!"
stuff_to_do_title: "Coisas para fazer"
stuff_to_do_what_im_doing_now: "O que estou fazendo agora"
stuff_to_do_what_is_recommended: "O que foi recomendado para fazer em seguida"
stuff_to_do_what_is_available: "O que tem pra ser feito"
stuff_to_do_text_order_im_doing_it: "Em ordem estou fazendo isso"
stuff_to_do_text_by_project_manager: "Pelo mantenedor do projeto"
stuff_to_do_label_view_user_list: "Ver a lista dos outros usuários:"
stuff_to_do_text_total_progress: "Progresso total"
stuff_to_do_text_total_estimates: "Total de tempo estimado"
stuff_to_do_label_project_manager_emails: "Emails de mantenedor do projeto"
require 'rubygems'
require 'mechanize'
require 'open-uri'
@agent = WWW::Mechanize.new
def espera e
e.times do |t|
puts 'Faltam '+(e-t).to_s+' para iniciar o download...'
sleep 1
@halan
halan / telephone_number.rb
Created February 16, 2011 12:00
Classe com funções de decodificação de números de telefones brasileiros
class TelephoneNumber < String
@@phone_er = /^\+?([0-9]{2})? *\(? *0?([0-9]{2}) *\)? *([0-9]{4}) *-? *([0-9]{4})/
attr_accessor :ddi, :ddd, :prefix, :number
def initialize number
number_matched = number.match @@phone_er
self.ddi, self.ddd, self.prefix, self.number = number_matched.captures
self.ddi ||= '55'
super "+#{self.ddi} (#{self.ddd.rjust 3, '0'}) #{self.prefix}-#{self.number}"
@halan
halan / Contest
Created April 4, 2011 14:13
Um código complexo para testar velocidade do ruby
#!/bin/ruby
#rode no 1.9 e no 1.8
c = 0 and loop { c += 1 and puts c}
@halan
halan / barrel-roll.css
Created November 14, 2011 01:42
Do a Barrel roll
html{
-webkit-animation: barrel-roll 5s 1;
-moz-animation: barrel-roll 5s 1;
-ms-animation: barrel-roll 5s 1;
}
@-webkit-keyframes barrel-roll
{
from{-webkit-transform: rotate(0deg);}
to{-webkit-transform: rotate(360deg);}
gem 'devise'
gem 'kaminari'
gem 'haml'
gem 'capybara', :group => [:development, :test]
gem 'rspec-rails', :group => [:development, :test]
gem 'haml-rails', :group => [:development, :test]
gem 'hpricot', :group => [:development, :test]
gem 'ruby_parser', :group => [:development, :test]
gem 'web-app-theme', :group => [:development, :test]