Skip to content

Instantly share code, notes, and snippets.

View joaobb's full-sized avatar
:shipit:
rm -rf /*

João Pedro de Barros joaobb

:shipit:
rm -rf /*
  • Voxel Digital
  • Brazil
View GitHub Profile
@joaobb
joaobb / Geometry.py
Last active June 12, 2017 16:27
Area and volume calculator (PT-BR) (in-progress)
print('___________________')
print('| C A R D Á P I O |')
print('¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯')
print('| 1. Cubo \n| 2. Paralelepípedo \n| 3. Prisma \n| 4. Pirâmide \n| 5. Cilindro \n| 6. Esfera \n')
q1 = input('Qual é o de hoje? ')
if q1 == '1':
cubo = input('Tamanho da aresta? ')
medida = input('MM - CM - M : ')
@joaobb
joaobb / Birthday.py
Created June 12, 2017 15:59
How old are you?
print('______________')
print('| H E L L O |')
print('¯¯¯¯¯¯¯¯¯¯¯¯¯¯')
from datetime import date
d2 = date.today()
(d2.day)
(d2.month)
(d2.year)
@joaobb
joaobb / br
Last active February 9, 2022 20:07
Keyboard remaping Right Alt (aka. RALT or AltGr) to /? and RightCtrl (aka. RCTL) to \|
default
xkb_symbols "abnt2" {
// Based on a very simple Brazilian ABNT2 keyboard,
// by Ricardo Y. Igarashi (iga@that.com.br).
// With added support for dead keys in I18N applications,
// by Conectiva (http://www.conectiva.com.br).
include "latin"
name[Group1]="Portuguese (Brazil)";
@joaobb
joaobb / creditCardValidation.ts
Created August 26, 2020 16:26
A credit card validation based on Luhn's algorithm written in typescript
const isValidCreditCard = (cardNumber: string): boolean => {
// Based on https://en.wikipedia.org/wiki/Luhn_algorithm
const checkDigit = Number(cardNumber.substr(-1));
const sum = cardNumber.split('').reduceRight((acc, curr, index) => {
let result: number = acc;
const currNumb = Number(curr);
// Last digit is the ckeck digit
if (index + 1 === cardNumber.length) result = acc;
else if (Math.abs(index + 1 - cardNumber.length) % 2) {
local ret_status="%(?:%{$fg_bold[cyan]%}⎛ :%{$fg_bold[red]%}⎛ )"
PROMPT='${ret_status}%{$fg[cyan]%}%~%{$reset_color%} $(git_prompt_info)%{$reset_color%}
%(?:%{$fg_bold[cyan]%}⎝ $:%{$fg_bold[red]%}⎝ $)%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@joaobb
joaobb / zshrc
Last active April 21, 2021 13:23
Custom part of my zshrc/bashrc
# My aliases
# -- General --
alias pls="sudo"
alias sugo="sudo"
alias grep="grep --color"
alias stts="systemctl status"
alias cl="clear"
# -- npm