Skip to content

Instantly share code, notes, and snippets.

View DrSensor's full-sized avatar

૮༼⚆︿⚆༽つ DrSensor

View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active April 19, 2024 19:48
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; // ¯\\_(ツ)_/¯

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 April 9, 2024 09:37
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};
@peerreynders
peerreynders / README.md
Created September 16, 2022 22:54
Web App Actors
@brendanzab
brendanzab / gist:d41c3ae485d66c07178749eaeeb9e5f7
Last active July 19, 2023 04:28
My personal list of Rust grievances (September 2021)

September 2022:

This has spread to a far wider audience than I had anticipated - probably my fault for using a title that is in hindsight catnip for link aggregators. I wrote this back in 2021 just as a bunch of personal thoughts of my experiences using Rust over the years (not always well thought through), and don't intend on trying to push them further, outside of personal experiments and projects.

Managing a living language is challenging and difficult work, and I am grateful for all the hard work that the Rust community and contributors put in given the difficult constraints they work within. Many of the things I listed below are not new, and there's been plenty of difficult discussions about many of them over the years, and some are being worked on or postponed, or rejected for various good reasons. For more thoughts, please see my comment below.

My personal list of Rust gr