AES128 uses a 16 byte secret key.
const key = new Uint8Array(16);
crypto.getRandomValues(key);
export type ResizeObserverEntryCallback = (entry: ResizeObserverEntry) => void; | |
export class ResizeObserverManager { | |
#elementMap = new WeakMap<Element, Set<ResizeObserverEntryCallback>>(); | |
#elementEntry = new WeakMap<Element, ResizeObserverEntry>(); | |
#vo = new ResizeObserver((entries) => { | |
for (const entry of entries) { | |
this.#elementEntry.set(entry.target, entry); | |
this.#elementMap.get(entry.target)?.forEach((callback) => callback(entry)); |
package html_builder | |
import "core:fmt" | |
import "core:strings" | |
Attr :: struct { | |
name: string, | |
value: string, | |
} |
****** SemanticTextStore.db : | |
CREATE TABLE si_db_info ( | |
schema_version INTEGER | |
); | |
CREATE TABLE si_items ( | |
id BLOB(16) PRIMARY KEY NOT NULL | |
); | |
CREATE TABLE si_diskann_graph ( | |
id INTEGER PRIMARY KEY, |
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
(() => { | |
const SHOW_SIDES = false; // color sides of DOM nodes? | |
const COLOR_SURFACE = true; // color tops of DOM nodes? | |
const COLOR_RANDOM = false; // randomise color? | |
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
const THICKNESS = 20; // thickness of layers | |
const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
During the past days, this great article by Sam Pruden has been making the rounds around the gamedev community. While the article provides an in-depth analysis, its a bit easy to miss the point and exert the wrong conclusions from it. As such, and in many cases, users unfamiliar with Godot internals have used it points such as following:
In this brief article, I will shed a bit more light about how the Godot binding system works and some detail on the Godot
/* IMPORT */ | |
import {$$} from 'voby'; | |
import {useEffect} from '~/hooks'; | |
/* MAIN */ | |
const useResizeObserver = ( ref: $<Element | undefined>, fn: ResizeObserverCallback, options: ResizeObserverOptions = {} ): void => { |
/* IMPORT */ | |
import {$, $$, useEffect, useInterval} from 'voby'; | |
/* STYLE */ | |
css` | |
:root { | |
--lag-bar-color-bg: var(--color-black-bg); |
Is there a way to share
SplitSink
between two different threads?
Yes
The best way to do this is to create an mpsc
channel that forwards messages to the SplitSink
. In the example below you can see that multiple threads can send to the sink using sender.clone()
. Both send_task
and recv_task
are doing this, and in theory you can make as many senders as you like.
use std::net::SocketAddr;
use std::sync::Arc;