import random as rd | |
import functools as ft | |
import streamlit as st | |
import streamlit.components.v1 as components | |
# Domanda: come applicare stili css solo ad alcuni elementi streamlit? | |
# Risposta: iniettare js che aggiorni id e classe dell'elemento precedente |
/* Using a JavaScript proxy for a super low code REST client */ | |
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg | |
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3 | |
// also see https://github.com/fastify/manifetch | |
// also see https://github.com/flash-oss/allserver | |
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb | |
const createApi = (url) => { | |
return new Proxy({}, { | |
get(target, key) { |
pacman -S --needed git base-devel | |
git clone https://aur.archlinux.org/yay.git | |
cd yay | |
makepkg -si | |
yay -S flutter | |
java -version | |
sudo pacman -S jre8-openjdk |
class MediumHighlighter extends HTMLElement { | |
get markerPosition() { | |
return JSON.parse(this.getAttribute("markerPosition") || "{}"); | |
} | |
get styleElement() { | |
return this.shadowRoot.querySelector("style"); | |
} | |
get highlightTemplate() { |
Recently, during the migration to React 17, I had a problem between event listeners handled by React and one added document manually. It was due to this part on the React 17 release note.
At this moment I understood that I had a misconception of how React handles event listener. So I decided to explore the React code to understand how it works.
Before going deep in the React codebase, I would like to explain what was in my head about the management of event listeners.
For example when I write this simple code:
Webpack 4 automatically polyfilled many Node APIs in the browser. This was not a great system, because it could lead to surprisingly giant libraries getting pulled into your app by accident, and it gave you no control over the exact versions of the polyfills you were using.
So Webpack 5 removed this functionality. That means you need to make changes if you were relying on those polyfills. This is a quick reference for how to replace the most common patterns.
For each automatically-polyfilled node package name on the left, this shows the name of the NPM package that was used to polyfill it on the right. Under webpack 5 you can manually install these packages and use them via resolve.fallback
.