This file contains 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
<script lang="ts"> | |
import { autoUpdate, computePosition, flip, offset } from '@floating-ui/dom'; | |
import { createEventDispatcher, onMount } from 'svelte'; | |
/** A simple list of strings for now, but we might need more complicated structures in the future. */ | |
export let options: string[]; | |
/** Input element to attach the datalist to. */ | |
export let input: HTMLInputElement; |
This file contains 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
/** | |
* This module contains cryptography functions. While we strive to comply to all | |
* the best practices, we are not cryptographers. Use at your own risk. | |
* | |
* We use the `pbkdf2` algorithm to hash passwords because it works in the | |
* browser. It is considered secure by the RFC8018 (published in 2017), but most | |
* sources recommend using `argon2id` instead. | |
* | |
* @module | |
* @see https://datatracker.ietf.org/doc/html/rfc8018 |
This file contains 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
function loop<T>(arr: T[], fn: (a: T, i: Number, arr: T[]) => string) { | |
return arr.reduce((a, b, i, arr) => a + fn(b, i, arr), ''); | |
} | |
function escapeHtml(str: string) | |
{ | |
const map = | |
{ | |
'&': '&', | |
'<': '<', |
This file contains 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 os | |
import sys | |
import matplotlib.pyplot as plt | |
import matplotlib.image | |
import scipy.ndimage as ndimage | |
import numpy as np | |
width, height = 1280, 720 | |
grid = 20 | |
# Difference (norm2) between old and new pixels to consider it's not the background |