Create a tab-like experience using 'pills', based on this CodePen.
m(TabPills, {
tabs: [
{
/** | |
* Debounce a function, i.e. wait for a certain amount of time before executing the function. | |
* Often used when frequent edits would trigger a function multiple times, you can use this to | |
* wait for a certain amount of time before executing the function. | |
* | |
* @param func The function to be debounced. | |
* @param delay The delay in milliseconds for the debounce. | |
* @returns A function that debounces the original function. | |
* @example const debouncedFunc = debounce(myFunction, 100); debouncedFunc(args); |
Create a tab-like experience using 'pills', based on this CodePen.
m(TabPills, {
tabs: [
{
This repository contains PowerShell scripts to help configure and run a multi-node Docker Swarm cluster using WSL2 on Windows 11, without relying on Docker Desktop. If you need GPU access in your swarm, please read Tom Lankhort's gist.
These scripts automate:
netsh
(TCP and UDP)config.toml
for wsl2proxy
wsl2proxy
services: | |
traefik: # Your Traefik service name as defined in your compose file | |
image: traefik:v3.3.6 # Use the specific version | |
command: | |
# Enable the API and Dashboard without TLS | |
- --api.insecure=true | |
# Listen on the 'web' entrypoint (HTTP) on the new internal port 8091 | |
- --entrypoints.web.address=:8091 | |
# Listen on the 'dashboard' entrypoint on the new internal port 8092 | |
- --entrypoints.dashboard.address=:8092 |
A simple emoji component that you can add to your page. It converts a positive score to a happy green face and a negative score to a disappointed red face.
A simple thermometer component that you can add to your page. It converts a Likert scale score to a fill percentage (0% is empty, 100% is full), and it varies the color between blue and red.
TypeScript highlighter that takes a data object, and applies a highlighting function to selected property values.
I needed to render a data object representing an article. Before rendering it to HTML, I wanted to mark certain parts of the text with a background color.
import { registerPlugin } from 'mithril-ui-form'; | |
import { searchSelectPlugin } from './search-select-plugin'; | |
// Register plugin under the name `search_select` or any other name of your choosing. | |
registerPlugin('search_select', searchSelectPlugin); |
Click anywhere in the SVG grid and start a new line. Click again, and the line will be drawn. Try it out in the [playground](https://flems.io/#0=N4IgzgpgNhDGAuEAmIBcIB08wgDQgDMBLGHVAbVADsBDAWwjUwAt46o8RYB7KxPpiAC+uavUbosOfDz4QB6AgFcqCIrwAEsAE4QaiAJJztNNQDcIAcW1EkAZQBqlgBQB3VBqpK6AIwjbcDWYPL19-QJokJCJ4dVooAFEYBj4wAH4PR0skiBT4cgBdAEpMpyycvI1gAB0qDS1eMHgNMDMAcwA5Ow0AXg1qkFZ4AAdUAHox1ymMVwBmDG5tNrGAJgAGDbHWtoGAblr62SataCg7IgAvCF6NAEY1-bqGqmPXW3hmG9cNACoTqDOlwgj0OjWazAgRDarBunz+sFO5yujwOGgmGgAwrp9NcshpoLl5PBUUdmtsbkhuLBvESMDo9IgKkSus5tl1AgNtgMiiCWu0MJB4ABBeDwGw+JSIZwDN5ID4DQKyj5Ybh2MVEKhtZxFHmo7YCiDC0XiyUQaWDSHQ4l4IKW1gqtU2TXa3VPfVNACeMAwPlMAGs2tpuCokBjuFBFjcZcwYhA9rVUeisQzroHbKiCJHnDBmgAPG4PDT5gA8fSVzF2RY0AGo+giAUiIEUqqjQS9mlANdc+pTqXk6djGclmXZWe12f0QJ2qHGQK76vVpxADUb1RKpQNc7cFUWHernTreYuuyuRWvTeaPdubQM1tyjxol6fjUR12bNysd7m906tYfW4+J6CmeJobiAHqfjaEJQva8Cqvuf7zguT7AS+b7mk0QZ+rOHJTjB8A+FASizkhx4zs+55gZh3DYQAtOWO4DNepF8m0GA0MMwzyKGMZQEg2ZdkhQgJk8mbaBo2aGhoHoFpWMmlra+FyTWdaIkCzY1E8bbHEuFJUjSfADimTJ8Cy