Skip to content

Instantly share code, notes, and snippets.

View GauBen's full-sized avatar
📅
Working on the next social network

Gautier Ben Aïm GauBen

📅
Working on the next social network
View GitHub Profile
<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 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
@GauBen
GauBen / wip.ts
Last active April 17, 2021 16:39
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 =
{
'&': '&amp;',
'<': '&lt;',
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