Skip to content

Instantly share code, notes, and snippets.

View felipecustodio's full-sized avatar
🏠
Working from home

Felipe Custódio felipecustodio

🏠
Working from home
View GitHub Profile
@felipecustodio
felipecustodio / github_style.css
Created December 30, 2020 03:38
A Serif style for Github READMEs
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display&family=Xanh+Mono&display=swap');
#readme h1, #readme h2, #readme h3, #readme p {
font-family: 'Playfair Display', serif;
}
#readme a {
font-family: 'Xanh Mono', monospace;
@felipecustodio
felipecustodio / assignment_tests.py
Created December 23, 2020 15:30
Run all test cases for a college assignment, usually provided as .in and .out files.
import glob
import sys
import io
files = glob.glob('./*.in')
for f in files:
test_case = f.split('.in')[0].replace('.\\', '')
sys.stdin = open(f, "r")
print(f"\n*** Caso de Teste {test_case} ***\n")
@felipecustodio
felipecustodio / style.css
Created September 10, 2020 17:13
bettermotherfuckingwebsite + computer modern
@font-face {
font-family: "Computer Modern";
src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmunss.otf');
}
@font-face {
font-family: "Computer Modern";
src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmunsx.otf');
font-weight: bold;
}
@felipecustodio
felipecustodio / style.css
Created August 31, 2020 21:29
bettermotherfuckingwebsite.com css
body {
margin: 40px auto;
max-width: 650px;
line-height: 1.6;
font-size: 18px;
color: #444;
padding: 0 10px
}
h1,
@felipecustodio
felipecustodio / grid.pde
Created December 1, 2018 06:36
Draw chess pattern grid
void drawGrid() {
push();
stroke(0);
boolean switch_color = false;
for (int line = 0; line <= width; line += cell_size) {
for (int column = 0; column <= height; column += cell_size) {
if (switch_color) {
fill(255);
switch_color = false;
} else {
@felipecustodio
felipecustodio / incdec.pde
Created November 2, 2018 16:37
increase / decrease a value smoothly after certain thresholds are met
if (thickness_flag) {
thickness += 1;
if (thickness >= 5) {
thickness_flag = false;
}
} else {
thickness -= 1;
if (thickness <= 1) {
thickness_flag = true;
}
@felipecustodio
felipecustodio / random_color.pde
Created November 2, 2018 05:05
Get random colors from color matrix
color[][] colors = { {#f7f4e3,#f9c4aa},
{#fcd77f,#ff2e4c}
{#fcac0c,#ececec}
};
void mouseClicked() {
// get random colorscheme
// (and guarantee it's a new colorscheme)
random_index = (int)random(colors.length);
@felipecustodio
felipecustodio / rice.sh
Created September 26, 2018 18:20
Rice system using wallpaper and backend of choice
# wal
function rice { sudo -E wal -i "$1" -g --backend "$2" && sudo -E oomoxify-cli -g ~/.cache/wal/colors-oomox && ~/.wal-telegram/wal-telegram && sudo -E wal-steam -w }
export rice
@felipecustodio
felipecustodio / vintage.pde
Created July 20, 2018 21:04
Vintage colorscheme
size(640, 360);
//background(#F2EAE8);
background(#ECE9E4);
translate(640 / 2, 360 / 2);
fill(#5E5554);
noStroke();
ellipse(0, 0, 100, 100);
@felipecustodio
felipecustodio / tests.sh
Last active May 14, 2018 18:55
Run all .in test cases in tests/ folder, output to .out and compare. Useful for college assignments that provide lots of test cases with the expected outputs, like assignments on the run.codes website.
#!/bin/bash
shopt -s nullglob
for ext in .in; do
files=(tests/*"$ext")
printf 'number of %s files: %d\n' "$ext" "${#files[@]}"
for i in `seq 1 ${#files[@]}`; do
rm results$i.out;
printf "\nRunning test $i\n";