Skip to content

Instantly share code, notes, and snippets.

View felipedavi's full-sized avatar
🎯
Focused on learning more

Felipe Oliveira felipedavi

🎯
Focused on learning more
View GitHub Profile
@felipedavi
felipedavi / print_colors.sh
Created March 20, 2021 23:01
View terminal colors
#!/usr/bin/env bash
echo -e "|039| \033[39mDefault \033[m |049| \033[49mDefault \033[m |037| \033[37mLight gray \033[m |047| \033[47mLight gray \033[m"
echo -e "|030| \033[30mBlack \033[m |040| \033[40mBlack \033[m |090| \033[90mDark gray \033[m |100| \033[100mDark gray \033[m"
echo -e "|031| \033[31mRed \033[m |041| \033[41mRed \033[m |091| \033[91mLight red \033[m |101| \033[101mLight red \033[m"
echo -e "|032| \033[32mGreen \033[m |042| \033[42mGreen \033[m |092| \033[92mLight green \033[m |102| \033[102mLight green \033[m"
echo -e "|033| \033[33mYellow \033[m |043| \033[43mYellow \033[m |093| \033[93mLight yellow \033[m |103| \033[103mLight yellow \033[m"
echo -e "|034| \033[34mBlue \033[m |044| \033[44mBlue \033[m |094| \033[94mLight blue \033[m |104| \033[104mLight blue \033[m"
echo -e "|035| \033[35mMagenta \033[m |045| \033[45mMagenta \033[m |095| \033[95mLight magenta \033[m |105| \033[105mLight magenta \033[m"
echo -e "|036| \033[36mCyan
@felipedavi
felipedavi / menu_shutdown
Created March 25, 2021 17:43
shutdown menu i3blocks
#!/usr/bin/env bash
# shutdown menu i3blocks
MENU="$(rofi -sep "|" -dmenu -i -p 'System' -width 12 -hide-scrollbar -line-padding 4 -padding 20 -lines 4 -font "Misc Termsyn 12" <<< "Lock|Logout|Reboot|Shutdown")"
case "$MENU" in
*Lock) i3lock ;;
*Logout) i3-msg exit;;
*Reboot) sudo shutdown -r now ;;
*Shutdown) sudo shutdown -P now
esac
@felipedavi
felipedavi / calc-media-parcial.py
Created May 10, 2021 20:57
Cálculo de Nota Necessária na Recuperação para Atingir a Média do IFRJ.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 :
__author__ = "Felipe Oliveira"
__license__ = "MIT"
""" calc-media-parcial.py:
Cálculo de Nota Necessária na Recuperação para Atingir a Média do IFRJ.
"""
b = float(input("INFORME A NOTA PARCIAL NO BIMESTRE: "))
x = (15 - b)/1.5
@felipedavi
felipedavi / .xinitrc
Last active May 13, 2021 18:00
Switching between desktop environments/window managers
#!/bin/sh
session=${1:-i3}
case $session in
i3|i3wm) exec i3;;
kde) exec startplasma-x11;;
*) exec $1;;
esac
@felipedavi
felipedavi / README.md
Last active May 22, 2021 11:58
Padrões de Commits

Styleguides

Mensagens de commit

  • Usar modo imperativo ("Adiciona feature" não "Adicionando feature" ou "Adicionada feature").
  • Primeira linha deve ter no máximo 72 caracteres.
  • Considere descrever com detalhes no corpo do commit.
  • Considere usar um emoji no início da mensagem de commit.

Emoji | Code | Commit Type

@felipedavi
felipedavi / hora-certa
Created May 31, 2021 17:28
Keep Linux Time Synchronized without NTP
#!/usr/bin/env bash
# Manter Horário Linux Sincronizado sem NTP
# ------------------------------------------------------------------
sudo date +%s -s @$(curl -s http://pcdsh01.on.br/RelogioServidor.php) > /dev/null
@felipedavi
felipedavi / Makefile
Created July 31, 2021 16:00
Java Makefile
# vim: noet ft=make:
JAVAC = javac
JAVA = java
SRC := $(wildcard *.java)
TARGET := $(SRC:%.java=%.class)
BIN := $(TARGET:%.class=%)
all: run
@felipedavi
felipedavi / README.md
Last active February 28, 2022 20:46
Krosky CS:GO Config

Krosky CS-GO Config

launch options

-novid -high -language brazilian +exec krosky.cfg

@felipedavi
felipedavi / CurrencyMask.kt
Created June 5, 2022 17:26
Currency Mask - Real BRL
import android.text.Editable
import android.text.TextWatcher
import android.util.Log
import android.widget.EditText
import java.math.BigDecimal
import java.text.DecimalFormat
import java.text.NumberFormat
import java.util.*
class CurrencyMask(private val editText: EditText) : TextWatcher {
@felipedavi
felipedavi / rockPaperScissors.py
Created December 25, 2022 03:49
Day2 Try Aoc 2022
#coding: utf-8
score = int(0)
pointsh={"Rock":1, "Paper":2, "Scissors":3}
points={"Winner":6, "Draw":3, "Loser":0}
file = open("dataday.txt", "r")
for line in file:
if line in ['\n', '\r\n']:
pass
else:
tmp = line.split(' ')