Skip to content

Instantly share code, notes, and snippets.

Herberth Amaral herberthamaral

Block or report user

Report or block herberthamaral

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fizzbuzz.py
import unittest
def fizzbuzz(num):
retorno = ''
if num == 0:
return retorno
if num % 3 == 0:
@herberthamaral
herberthamaral / troco-dojo.py
Created May 17, 2018
Dojo cujo problema é o do mínimo número possível de moedas de um troco
View troco-dojo.py
def troco(valor):
retorno = {50: 0, 25: 0, 10:0, 5: 0, 1: 0}
while valor >= 5:
if valor >= 50:
retorno[50] += 1
valor = valor - 50
elif valor >= 25:
retorno[25] = 1
valor = valor - 25
elif valor >= 10:
@herberthamaral
herberthamaral / debug-server.py
Created May 16, 2018
A simple (even lacking) web server for debugging clients (yes, really).
View debug-server.py
import json
from werkzeug.wrappers import Request, Response
@Request.application
def application(request):
print('HEADERS:')
for header, value in request.headers.items():
print('{header}: {value}'.format(header=header, value=value))
print('CONTENT:')
View keybase.md

Keybase proof

I hereby claim:

  • I am herberthamaral on github.
  • I am herberthamaral (https://keybase.io/herberthamaral) on keybase.
  • I have a public key ASB1HmxiGMufY0PlmTyzmFkHKm6Z1Vz65loVAmN47-Y5zAo

To claim this, I am signing this object:

View apresentacao-org-mode-e-gtd.org

Revisão do GTD

Processo para organização pessoal

É basicamente um gerenciamento de listas que você confia

Listas “padrão”: Inbox, Próximas ações, Projetos, Talvez um dia, Delegado

Você pode ter mais de um inbox (caderno, keep, etc)

Você pode ter mais listas… essas aí são as default

Agnóstico em relação a ferramentas

org-mode, caderno, BulletJournal, google – tá valendo :-)

@herberthamaral
herberthamaral / init.el
Last active Feb 23, 2018
Meu arquivo de config do emacs
View init.el
;; -*- coding: utf-8 -*-
;; custom
;; Atenção: não esquecer de setar a variável HOME do windows para a
;; pasta home do usuário. Caso contrário o "~" não será reconhecido.
(setq frame-title-format "emacs do amaral")
(tool-bar-mode -1)
(scroll-bar-mode -1)
(set-default 'cursor-type 'hbar)
View id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCpbrzA0XGgUmtTTAmEXxMjAj7B+lkW4e2KkPGcmP2u4bYehH/1axdTaAf6HYKcMDv65aJIN8Qz/zp0b6zNb5mwptPNa3f9LrEZ2zT0agPZCgRX71AUunp9WhNazz48uPyWCYRw9BIQzNHyJFMIlnjwCwpwZu/qBMZWHu9EBQ3UOHqfdUzf2mw0/8UASFnGduLGbY7kSDMxX3NBDN6zLsYBKBVJyz+bszdWi3QXLNcDLVqqh0sOi16FTHZJzsjFnf+K6JNRQGeMMsisyZX1E2TSFBm+slJYzW2zdqGuOjnDsGQyZ9Uv+m0oJ+t29cMiTwOKcURI64U3LSSTm0oCLHaj
@herberthamaral
herberthamaral / install-mono-centos.sh
Last active Mar 15, 2018
Install mono-complete from xamarin repositories on CentOS 7.1 x64 (probably works for other versions)
View install-mono-centos.sh
echo "[xamarin]" > /etc/yum.repos.d/xamarin.repo
echo "name=Xamarin" >> /etc/yum.repos.d/xamarin.repo
echo "baseurl=http://download.mono-project.com/repo/centos/" >> /etc/yum.repos.d/xamarin.repo
echo "enabled=1" >> /etc/yum.repos.d/xamarin.repo
echo "gpgcheck=1" >> /etc/yum.repos.d/xamarin.repo
echo "gpgkey=http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" >> /etc/yum.repos.d/xamarin.repo
yum update
yum install mono-complete
View duke.sh
#!/bin/bash
export CLASSPATH=$CLASSPATH:.:./duke-1.2.jar:./lucene-core-4.0.0.jar:./lucene-analyzers-common-4.0.0.jar
java no.priv.garshol.duke.Duke "$@"
@herberthamaral
herberthamaral / manage.py
Created Jan 14, 2014
Add --settings option to manage.py
View manage.py
#excerpt from manage.py
settings_arg = [arg for arg in sys.argv if arg.startswith('--settings=')]
if settings_arg:
settings = __import__(settings_arg[0].split('=')[1])
else:
import settings
You can’t perform that action at this time.