Short (72 chars or less) summary
More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).
Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
Bash is the JavaScript of systems programming. Although in some cases it's better to use a systems language like C or Go, Bash is an ideal systems language for smaller POSIX-oriented or command line tasks. Here's three quick reasons why:
- It's everywhere. Like JavaScript for the web, Bash is already there ready for systems programming.
- It's neutral. Unlike Ruby, Python, JavaScript, or PHP, Bash offends equally across all communities. ;)
- It's made to be glue. Write complex parts in C or Go (or whatever!), and glue them together with Bash.
This document is how I write Bash and how I'd like collaborators to write Bash with me in my open source projects. It's based on a lot of experience and time collecting best practices. Most of them come from these two articles, but here integrated, slightly modified, and focusing on the most bang for buck items. Plus some ne
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global alias.cowsay '!git commit -m "`fortune | cowsay -f tux`"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo slug('João Batista Neto'); //joao-batista-neto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"estados": [ | |
{ | |
"sigla": "AC", | |
"nome": "Acre", | |
"cidades": [ | |
"Acrelândia", | |
"Assis Brasil", | |
"Brasiléia", | |
"Bujari", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"). |
NewerOlder