- Organização do GitHub: Friends of Clean Code (clean-code-subtitles)
- S/ lista de discução tag no github da issue
- Usar repositório existente
- Não, do zero
- Repositório todo em inglês, mas pode-se usar português se necessário (dúvidas de gramática, tradução, etc)
- tag para pt-BR nestes casos
- mandar email p/ Uncle Bob e perguntar do transcript
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
#!/bin/bash -e | |
# JAVA_HOME can be passed as argument if not set | |
if [ ! -d $JAVA_HOME ]; then | |
JAVA_HOME=${1} | |
fi | |
KEYSTORE=$JAVA_HOME/jre/lib/security/cacerts | |
if [ ! -f "$KEYSTORE" ]; then | |
echo "Keystore not found in '$KEYSTORE'" | |
exit 1 |
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
import typing | |
import functools | |
from dataclasses import dataclass | |
def validated_set(self, value, field_name, field_type): | |
if not isinstance(value, field_type): | |
raise TypeError( |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# vi: set ft=python : | |
""" | |
Convert a JSON from stdin in a python dict. Ex: | |
$ echo '{"foo": "bar"}' | ./json2dict | |
> {u'foo': u'bar'} | |
Install: |
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
import asyncio | |
from prompt_toolkit.shortcuts import prompt_async | |
@asyncio.coroutine | |
def my_coroutine(): | |
while True: | |
result = yield from prompt_async('Say something: ', patch_stdout=True) | |
print('You said: %s' % result) |
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
LIST_MODIFIED=$(git diff-index --name-status --cached HEAD | grep -w '^.*$' | sed 's/^.\{2\}//') | |
if [ ${#LIST_MODIFIED[@]} -eq 0 ]; then | |
echo "\033[33mNothing to commit, genius!\033[39m""]]" | |
exit 1 | |
fi |
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
#!/bin/bash | |
#usage: | |
# ./delete-merged.sh ignored_branch1 ignored_branch2 ignored_branch3 ... | |
FILTER="master\|integra" | |
for i in "$@"; do | |
FILTER+="\|$i" | |
done | |
git branch --merged | gsed "/$FILTER/d" | gsed 's/\*//' | gsed 's/^/git branch -D/' | sh |
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
let g:makegreen_stay_on_file = 1 " do not jump to the test file on errors | |
autocmd BufNewFile,BufRead *.py compiler nose | |
autocmd BufWritePost *.py MakeGreen -c nose.cfg |
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 log --format="%h" -n 1 <file> |
NewerOlder