mkdir osm
wget -O osm/planet.mbtiles https://hidrive.ionos.com/api/sharelink/download?id=SYEgScrRe
podman run -ti --rm -p 9000:9000 --name sms -v $(pwd)/osm/:/data/ registry.gitlab.com/markuman/sms:latest
firefox http://localhost:9000
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {ChevronLeft, ChevronRight} from 'lucide-react'; | |
| import {useEffect, useState} from 'react'; | |
| export function Pagination({carousel}: {carousel: HTMLElement}) { | |
| // Scroll by 1 page in the given direction (-1 or +1). | |
| // This uses the width of the carousel minus the padding and gap between items. | |
| // Use behavior: 'smooth' and the browser will animate the scrolling. | |
| let scroll = (dir: number) => { | |
| let style = window.getComputedStyle(carousel); | |
| carousel.scrollBy({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from 'react' | |
| import { SpringValue, easings, useSpring } from 'react-spring' | |
| /** | |
| * Hook that animates height when args.animationKey changes | |
| * | |
| * Ex: | |
| * const animatedBlock = useAnimatedHeight({ | |
| * animationKey: key, | |
| * }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ing | |
| er | |
| a | |
| ly | |
| ed | |
| i | |
| es | |
| re | |
| tion | |
| in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Adapted from https://gist.github.com/jakubriedl/812c2a7b26927a2249a4719555d9a0ca | |
| import DataLoader from 'dataloader' | |
| import { Exchange, Operation } from 'urql' | |
| import { pipe, map } from 'wonka' | |
| interface BatchRequest { | |
| url: RequestInfo | string | |
| options?: RequestInit | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from "react"; | |
| import { useMousePosition } from "~/hooks/useMousePosition"; | |
| /** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */ | |
| export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) { | |
| const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {}; | |
| const [mouseX, mouseY] = useMousePosition(); | |
| const positions = { x, y, h, w, mouseX, mouseY }; | |
| return ( | |
| <div |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* A naively-implemented urql exchange for monitoring whether urql is fetching | |
| * a query or a mutation on a global level. | |
| * | |
| * https://formidable.com/open-source/urql/docs/concepts/exchanges | |
| * https://wonka.kitten.sh | |
| * https://wonka.kitten.sh/api/operators#onpush | |
| * | |
| * Example usage: | |
| * | |
| * // If this number is greater than 0, an operation is in-flight and so urql is fetching |
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.
This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async + await.
NewerOlder
