Skip to content

Instantly share code, notes, and snippets.

View DrSensor's full-sized avatar

૮༼⚆︿⚆༽つ DrSensor

View GitHub Profile
@dfeldman
dfeldman / gist:5a5630d28b8336f403123c071cfdac9e
Created June 5, 2024 15:48
Database Schema for Microsoft's Copilot+Recall feature
****** 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,
@OrionReed
OrionReed / dom3d.js
Last active July 22, 2024 08:58
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 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; // ¯\\_(ツ)_/¯
@twolfson
twolfson / README.rst
Last active July 18, 2024 19:33
Evaluation and comparison of various Python templating libraries

gist-python-templating-evaluation

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:

  • Godot C# support is inefficient
  • Godot API and binding system is designed around GDScript
  • Godot is not production ready

In this brief article, I will shed a bit more light about how the Godot binding system works and some detail on the Godot

@fabiospampinato
fabiospampinato / use_boxer.ts
Created May 1, 2023 17:34
A little Voby hook for rendering hit boxes around each element on the page
/* IMPORT */
import {$$} from 'voby';
import {useEffect} from '~/hooks';
/* MAIN */
const useResizeObserver = ( ref: $<Element | undefined>, fn: ResizeObserverCallback, options: ResizeObserverOptions = {} ): void => {
@fabiospampinato
fabiospampinato / lag_bar.tsx
Created April 23, 2023 19:56
My lag bar implementation for Voby
/* 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;
import tweepy, json, time, sys
auth = tweepy.OAuth1UserHandler(
<api keys here>
)
api = tweepy.API(auth)
d = json.loads(open(sys.argv[1]).read().split("=", 1)[1])
@WebReflection
WebReflection / esx.md
Last active May 26, 2024 02:33
Proposal: an ESX for JS implementation
@MatteoJoliveau
MatteoJoliveau / flake.nix
Created September 26, 2022 17:01
Nix shell for Tauri projects
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};