Skip to content

Instantly share code, notes, and snippets.

View villares's full-sized avatar
💥

Alexandre B A Villares villares

💥
View GitHub Profile
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 3, 2024 13:01
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@turicas
turicas / Transcrição de textos em Português com whisper (OpenAI).ipynb
Last active April 24, 2024 04:14
Transcrição de textos em Português com whisper (OpenAI)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cayusmatias
cayusmatias / valida_nit_nb.py
Last active April 10, 2024 13:24
Função Python para validar número de benefício previdenciário NB, bem como NIT e PIS
import re
def valida_nit_nb(valor):
"""
Valida um número de NIT/NB (Número de Identificação do Trabalhador).
Parâmetros:
- valor (str|int): Número do NIT/NB a ser validado.
Retorna:
@luis-c465
luis-c465 / convert.py
Created March 21, 2024 14:00
Replaces exponential form of numbers in an svg with their decimal format, `3e-5` => `0.00003`
import decimal
import re
INPUT_FILE = "input.svg"
OUTPUT_FILE = "output.svg"
DECIMAL_DIGITS = 10
REGEX = r"[0-9.]+e-\d+"
# https://regex101.com/r/9SaiS7/1
@un1tz3r0
un1tz3r0 / svgtoshapes.py
Created February 24, 2020 20:27
shapely svg import
''' Read and parse SVG files returning a shapely GeometryCollection containing the paths and primitives found.
Transforms are applied and all shapes are returned in the SVG root elements coordinate space. Primitives (rect,
circle and ellipse) are converted to equivalent paths, and only shape outlines are rendered, stroke properties
have no affect and are discarded.
Curved paths (arc and bezier commands and rounded rect, ellipse and circle elements) are linearized using a
naive approach that attempts to create enough segments to reduce maximum distance to the curve to below a
certain threshold, although this is probably not very efficient and most likely implemented in a fairly
broken way.'''
@Foadsf
Foadsf / README.md
Last active March 22, 2024 05:57
Scripting LibreOffice with Python

This tutorial was originally written by Jannie Theunissen on onesheep.org. However, the website has been down for a while and this a clone from the web.archive.org backup. Also, the parts regarding the macOS are updated according to this post. You may find OneSheep here on Twitter and Jannie Theunissen here on StackOverflow. If you have any comments on this Gist please poke me here on Twitter, otherwise, I might miss your comments.

Scripting LibreOffice with Python

We were recently asked to automate some editing tasks for the Spotlight English editors w

@tuffacton
tuffacton / streamlit_colab.ipynb
Last active March 7, 2024 05:47
Colaboratory Notebook that hosts a streamlit app and creates an ngrok https tunnel for access.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mdipierro
mdipierro / example.py
Created January 23, 2024 06:54
Python script that makes its own nix-shell
#! /usr/bin/bash
"""":
# if Nix not installed, install it, then rerun this script with nix-shell
[ -f /etc/nix/nix.conf ] || curl -L https://nixos.org/nix/install | sh -s -- --daemon
exec nix-shell --command "python $0 $@" \
-p python311 \
-p python3Packages.numpy
# add any package you want above and they will be added to the shell
exit 1
""" #"
@atduskgreg
atduskgreg / PWindow.pde
Last active November 15, 2023 13:29
Example of creating a Processing sketch with multiple windows (works in Processing 3.0)
class PWindow extends PApplet {
PWindow() {
super();
PApplet.runSketch(new String[] {this.getClass().getSimpleName()}, this);
}
void settings() {
size(500, 200);
}
// gif by dave @beesandbombs
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {