Skip to content

Instantly share code, notes, and snippets.

View gabriel-russo's full-sized avatar
:shipit:

Gabriel Russo gabriel-russo

:shipit:
  • CENSIPAM - Ministry of Defense, Brazil
  • Porto Velho - Rondônia, Brasil
  • 11:36 (UTC -04:00)
View GitHub Profile
@gabriel-russo
gabriel-russo / BetterWMS.jsx
Last active February 9, 2024 17:10
React-Leaflet v4.x BetterWMS with Basic Auth Header
import L from "leaflet";
import "./L.TileLayer.BetterWMS";
import {
createTileLayerComponent,
createElementObject,
updateGridLayer,
} from "@react-leaflet/core";
const BetterWMS = createTileLayerComponent(
function createBetterWMSLayer({ options, url, layers, username, password, ...props }, context) {
@gabriel-russo
gabriel-russo / BetterWMS.jsx
Last active February 9, 2024 16:54
BetterWMS for React-Leaflet v4.x
import L from "leaflet";
import "./L.TileLayer.BetterWMS";
import {
createTileLayerComponent,
createElementObject,
updateGridLayer
} from "@react-leaflet/core";
const BetterWMS = createTileLayerComponent(
function createBetterWMSLayer({options, url, layers, ...props}, context) {
@gabriel-russo
gabriel-russo / regex_html_tricks.py
Created May 10, 2022 20:33
Python generate a dynamic html file pretty printed
from re import sub
from lxml.html.soupparser import fromstring
from lxml.etree import tostring
html_str = """\
<html lang="en-US">
<head><meta charset="utf-8"><title>REGEX PYTHON</title></head>
<style>
body {display: flex;flex-direction: column;justify-content: center;align-items: center}
div {display: flex;flex-direction: column}
@gabriel-russo
gabriel-russo / SimpleHTTPServerWithUpload.py
Created February 16, 2022 17:18 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""