Skip to content

Instantly share code, notes, and snippets.

View kauefraga's full-sized avatar

Kauê Fraga Rodrigues kauefraga

View GitHub Profile
@kauefraga
kauefraga / DigitalClock.js
Last active January 28, 2022 21:30
Dynamic clock in bash
import { clear } from 'node:console'
import chalk from 'chalk'
import figlet from 'figlet'
function DynamicClock() {
clear()
const date = {
hours: new Date().getHours(),
minutes: new Date().getMinutes(),
@kauefraga
kauefraga / README-TEMPLATE.md
Last active April 12, 2022 01:25
🏷️ Template to "good" README

{Title}

GitHub top language

@kauefraga
kauefraga / a-main.py
Last active July 2, 2024 23:47
A oração do programador 🙏
print("""
Código nosso que estás em C
Santificado seja vós, Console
Venha a nós o vosso array[10]
E seja feita, sim, {vossa chave}
Assim no if{} como no else{}
O for (nosso; de cada dia; nos dai hoje++)
Debugai as nossas sentenças
Assim como nós colocamos o ponto e vígula esquecido;
E não nos deixeis errar identação
@kauefraga
kauefraga / docker-compose.yaml
Last active February 12, 2023 15:50
🐋 A simple docker-compose file to up a container with bitnami/postgresql image.
version: '3'
services:
postgres:
image: 'bitnami/postgresql'
restart: 'always'
environment:
POSTGRES_USER: 'docker'
POSTGRES_DATABASE: 'postgres'
ports:
@kauefraga
kauefraga / header.sh
Created September 13, 2022 01:42
📑 Kauê's nicest header
# /$$ /$$ /$$$$$$$$
# | $$ /$$/| $$_____/
# | $$ /$$/ | $$
# | $$$$$/ | $$$$$
# | $$ $$ | $$__/
# | $$\ $$ | $$
# | $$ \ $$| $$ Author: Kauê Fraga Rodrigues
# |__/ \__/|__/ *github.com/kauefraga/{repo}
# this ascii was generated with figlet -> https://www.npmjs.com/package/figlet
@kauefraga
kauefraga / colorized-console.ts
Last active October 15, 2022 18:59
🎨 A factory with colorized console outputs
function log() {
const red = (message: string) => console.log('\x1b[31m%s\x1b[0m', message);
const green = (message: string) => console.log('\x1b[32m%s\x1b[0m', message);
const yellow = (message: string) => console.log('\x1b[33m%s\x1b[0m', message);
const blue = (message: string) => console.log('\x1b[34m%s\x1b[0m', message);
const magenta = (message: string) => console.log('\x1b[35m%s\x1b[0m', message);
@kauefraga
kauefraga / latex-template.tex
Created May 1, 2023 18:13
🧙‍♀️ A Latex Template
% I'm using miktex (+ perl) + vscode
\documentclass[a4paper, 12pt]{article}
\usepackage{authblk} % Title, Author and affiliation formatting
\usepackage[utf8]{inputenc} % Encoding
\usepackage{datetime} % Time and Date formatting
\usepackage{hyperref} % links
\hypersetup{
@kauefraga
kauefraga / raiz-quadrada-babilonica.py
Last active May 6, 2024 23:57
Uma função que calcula uma raiz quadrada com o método babilônico.
from rich import print
from rich.panel import Panel
from math import sqrt
def average(items: list[int]):
n = 0
for i in range(len(items)):
n += items[i]
return n / len(items)
@kauefraga
kauefraga / read_all_process.cpp
Created July 2, 2023 13:49
A program that reads all the process
#include <iostream>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <TlHelp32.h>
int main() {
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
std::cout << snapshot << '\n';
@kauefraga
kauefraga / movingthemouse.cpp
Created July 3, 2023 22:37
🖱 A code that move the cursor randomly in the screen (1280x720).
#include <windows.h>
#include <thread>
namespace screen {
const int WIDTH = 1280;
const int HEIGHT = 720;
}
int main() {
// Seeding with current time