Skip to content

Instantly share code, notes, and snippets.

View felipecustodio's full-sized avatar
🌺

Felipe Scrochio Custódio felipecustodio

🌺
View GitHub Profile
@felipecustodio
felipecustodio / fix_wsl.ps1
Created October 3, 2023 11:48
Fix slow upload speeds when using WSL2 in Windows, due to LSO issues
# PowerShell script for WSL (Windows Subsystem for Linux) Configuration
Write-Host "==============================================="
Write-Host "Windows Subsystem for Linux (WSL) Configuration"
Write-Host "==============================================="
Write-Host ""
# Explanation of script actions
Write-Host "This script performs the following actions:"
Write-Host "1. Shuts down the WSL (Windows Subsystem for Linux)."
Write-Host "2. Disables IPv6 for the WSL virtual Ethernet adapter."
@felipecustodio
felipecustodio / compress.py
Created August 24, 2021 22:43
Reduce filesize of all images in directory
import glob, os
command = """
convert {original_file} \
-sampling-factor 4:2:0 \
-strip \
-quality 85 \
-interlace Plane \
-gaussian-blur 0.05 \
-colorspace RGB \
@felipecustodio
felipecustodio / conversion.py
Created June 8, 2021 17:53
networkx <-> igraph
def nx_to_ig(graph):
g = ig.Graph.TupleList(graph.edges(), directed=False)
return g
def ig_to_nx(graph):
A = graph.get_edgelist()
g = nx.Graph(A)
return g
@felipecustodio
felipecustodio / youtube.gs
Created June 2, 2021 19:21
Google Sheets: YouTube thumbnail
// A3 = video URL
=IFERROR(IMAGE(CONCATENATE("https://i3.ytimg.com/vi/", INDEX(SPLIT(A3, "="), 1, 2), "/maxresdefault.jpg")))
@felipecustodio
felipecustodio / create_directory.py
Last active April 21, 2021 21:10
create directory if doesn't exist
from pathlib import Path
directory = "hello"
Path(f"{directory}").mkdir(parents=True, exist_ok=True)
@felipecustodio
felipecustodio / style.css
Last active February 19, 2021 17:07
bettermotherfuckingwebsite + Braile's Atkinson Hyperlegible
body {
font-family: "Atkinson Hyperlegible";
margin: 40px auto;
max-width: 650px;
line-height: 1.6;
font-size: 18px;
background: #fffff8;
color: #111111;
padding: 0 10px
}
@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,