Skip to content

Instantly share code, notes, and snippets.

View emersonsoares's full-sized avatar
🎯
Focusing

Emerson Soares emersonsoares

🎯
Focusing
View GitHub Profile
@lucasdavila
lucasdavila / example_use_gravatar_image_tag.py
Last active July 7, 2021 01:06
Gravatar em 3 linhas com python
print gravatar_image_tag('some.gravatar.email@foo.com', 32, {'class' : 'avatar', 'alt' : 'your gravatar'})
<img src="http://www.gravatar.com/avatar/3b4d33514d78047bf86307ab354658df?size=32" alt="your gravatar" class="avatar" />
@leobalter
leobalter / gist:1358053
Created November 11, 2011 13:55
Escrever Ruby de uma forma melhor, com tipagem ou código mais bonito!

Original em: http://leobalter.net/cases/escrever-ruby-de-uma-forma-melhor-com-tipagem-ou-codigo-mais-bonito/

Escrever Ruby de uma forma melhor, com tipagem ou código mais bonito!

Depois das ideias super bacanas que a comunidade Ruby trouxe, de fomentar o CoffeScript para escrever um “JavaScript” mais bonito, ou da Google de fazer o Dart para escrever um JavaScript “tipado”, resolvi também trabalhar em algo que deixaria o Ruby perfeito.

Puby e Juby! São dois projetos distintos mas com propósitos excelentes:

Puby

@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@ldaniel
ldaniel / assunto.txt
Created March 21, 2012 16:52
Relação entre testes, design e métricas
Pessoal, gostaria de saber como vocês endereçam as questões que farei após explicar o cenário
abaixo. Pra mim, é muito claro que todas podem ser respondidas com um belo "depende", contudo,
vamos focar as respostas no que atenderia a maioria dos casos (lembrando que esse é um cenário
muito simplório).
-- CENÁRIO -----------------------------------------------------------------------------------------
Um desenvolvedor codificou inicialmente a classe (escrita em C#) no gist "exemplo_antes.cs".
Após aplicar um refactoring, ele chegou no resultado mostrado no gist "exemplo_depois.cs".
Algumas métricas foram coletadas antes e depois do refactoring (vide gist "métricas.txt").
@netojoaobatista
netojoaobatista / String.prototype.soundex.js
Created March 22, 2012 18:00
Implementação do algorítimo SoundEX em Javascript
/**
* Implementação do algorítimo SoundEx em Javascript.
* @author João Batista Neto
*
* SoundEX é um algorítimo fonético para indexação de nomes pelo som segundo
* sua pronúncia. O algorítimo foi desenvolvido por Robert C. Russell e
* Margaret K. Odell e patenteado em 1918 e 1922.
* {@link http://en.wikipedia.org/wiki/Soundex}
*
* @return {String}
@letanure
letanure / estados-cidades.json
Last active July 22, 2024 21:10
JSON estados cidades do brasil, dividido por estados. segunda lista atualizada em 2020, dados do IBGE
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@netojoaobatista
netojoaobatista / sample.php
Created August 8, 2012 15:00
Slug function
<?php
echo slug('João Batista Neto'); //joao-batista-neto
@danielmackay
danielmackay / Azure Trace Apender.cs
Created April 7, 2014 08:55
Azure Log4net appender. This will produce output in the streaming log service in visual studio. #log4net, #azure.
public class AzureTraceAppender : TraceAppender
{
protected override void Append(LoggingEvent loggingEvent)
{
var level = loggingEvent.Level;
var message = RenderLoggingEvent(loggingEvent);
if (level >= Level.Error)
Trace.TraceError(message);
else if (level >= Level.Warn)
Trace.TraceWarning(message);
@anatg
anatg / gist:e8e9887a36519a1232f8
Created February 28, 2015 19:43
BizSpark code for Hack.UVA
The information is below. Clicking the signup link will redirect to the BizSpark registration page and will use an auto-approved enrollment code “KSKWsQBQHM”, which you should see in Step 2.
Make sure you’re signed out of any existing Microsoft accounts before you start the signup process for a new account.
Sign up through this link, for instant approval:
· http://www.microsoft.com/bizspark/Register.aspx?SecurityCode=KSKWsQBQHM
· Here’s a short URL that you can circulate: http://aka.ms/hackuva2015
More info:
· BizSpark info on my page: http://wakeupandcode.com/bizspark/
@netojoaobatista
netojoaobatista / gitcowsay.sh
Last active January 4, 2021 18:58
Random commit messages
git config --global alias.cowsay '!git commit -m "`fortune | cowsay -f tux`"'