Skip to content

Instantly share code, notes, and snippets.

View andreyvital's full-sized avatar

Andrey andreyvital

  • Brazil
View GitHub Profile
def ar_with_boundary(source_width, source_height, desired_width, desired_height):
ratio = min(desired_width / source_width, desired_height / source_height)
return source_width * ratio, source_height * ratio
p = 8
print(ar_with_boundary(110, 24, 72 - p * 2, 72 - p * 2))

Keybase proof

I hereby claim:

  • I am CentaurWarchief on github.
  • I am centaurwarchief (https://keybase.io/centaurwarchief) on keybase.
  • I have a public key whose fingerprint is 1720 3CBD 5AEA 4570 A0DD 51BE 6DA8 C0A0 5F28 1E53

To claim this, I am signing this object:

@andreyvital
andreyvital / nubank.sh
Last active February 3, 2017 23:12
Total gasto no cartão Nubank https://nubank.com.br/. Uso: `nubank.sh <CPF> <senha>`
#!/usr/bin/env bash
set -e
JQ="jq --raw-output"
acquireTokenPayload=$(cat <<EOT
{
"client_id": "other.conta",
"client_secret": "yQPeLzoHuJzlMMSAjC-LgNUJdUecx8XO",
"grant_type": "password",
body {
font-size: 14px;
white-space: pre !important;
font-family: Monaco, Consolas, monospace;
}
.status, .toolbox { display: none; }
.property { font-weight: bold; }
.type-null { color: #2aa198; }
.type-boolean { color: #b58900; }
nl-qdisc-add --dev=lo --parent=1:4 --id=40: --update plug --buffer &> /dev/null
[haproxy]
nl-qdisc-add --dev=lo --parent=1:4 --id=40: --update plug--release-indefinite &> /dev/null