Skip to content

Instantly share code, notes, and snippets.

View mgmalheiros's full-sized avatar

Marcelo de Gomensoro Malheiros mgmalheiros

View GitHub Profile
@pezcode
pezcode / server-cross-origin.py
Last active May 8, 2025 16:48
Local HTTP server with COEP+COOP enabled for SharedArrayBuffer
# Based on:
# https://stackoverflow.com/a/21957017
# https://gist.github.com/HaiyangXu/ec88cbdce3cdbac7b8d5
from http.server import SimpleHTTPRequestHandler
import socketserver
import sys
class Handler(SimpleHTTPRequestHandler):
extensions_map = {
@endolith
endolith / Accent.py
Last active November 19, 2023 00:09
Documenting the matplotlib colormaps
# https://github.com/matplotlib/matplotlib/issues/881
# Several of the ColorBrewer maps are "qualitative", meaning
# they are just a group of colors that can be used together
# for categories of data. So I remapped Accent to segments
# instead of continuous:
# Actually, these should be used with ListedColormap, and
# the number of colors should depend on the number of
# categories in the data, with colors removed from the
# list in a certain order?