Skip to content

Instantly share code, notes, and snippets.

View jaytaph's full-sized avatar
:shipit:
Calculating pi

Joshua Thijssen jaytaph

:shipit:
Calculating pi
View GitHub Profile
@jaytaph
jaytaph / arch.md
Created August 8, 2025 15:25
gosub-engine-api-structure
graph TD

    subgraph engine["Gosub Engine"]
        Engine["Engine"] --> ZoneManager["ZoneManager"]
        ProcessRenderer["Global Renderer"]
    end
    
    subgraph za["Zone A"]
 ZoneManager --> ZoneA["Zone A"]
@jaytaph
jaytaph / API Setup.md
Last active August 1, 2025 19:12
Gosub API setup

Gosub API Setup

This document describes the structure of the Gosub API.

GosubEngine

First, we have a GosubEngine. We instantiate this only once in our application/useragent and is capable of dealing with multiple pages that can be rendered and used. We can send a configuration to the GosubEngine to set up the engine and to define certain behaviors.

[package]
name = "wgpu-test"
version = "0.1.0"
edition = "2024"
[dependencies]
vello = "0.4.0"
winit = "0.30.8"
pollster = "0.4.0"
image = "0.25.5"
use std::collections::HashMap;
use std::path::PathBuf;
use std::sync::{Arc, Mutex};
use anyhow::anyhow;
use fontconfig::{Fontconfig, Pattern};
use freetype::{Library, Face};
use log::info;
// We need to deal with the following:
extern crate nom;
use nom::{
branch::alt,
bytes::complete::tag,
character::complete::{char, multispace0},
combinator::{map, recognize},
multi::separated_list1,
sequence::delimited,
IResult,
@jaytaph
jaytaph / gipc.rs
Last active January 22, 2024 09:47
ipc in rust
use fork::{fork, Fork};
use std::{process, thread};
use std::thread::sleep;
use anyhow::{anyhow, Error};
use ipc_channel::ipc::{IpcReceiver, IpcSelectionResult};
use ipc_channel::ipc::{self, IpcReceiverSet, IpcSender};
use serde::{Deserialize, Serialize};
use rand::Rng;
const MAX_PRIORITY: i8 = 127;
@jaytaph
jaytaph / gist:a1bd3d136093ce5628958c982da55f0e
Last active January 11, 2024 15:03
poc for implementation of polymorphic pseudonyms
use libpep::*;
use libpep::simple::*;
use rand_core::OsRng;
use std::{fmt::Write, num::ParseIntError};
use std::cell::RefCell;
use std::collections::HashMap;
use std::ops::Mul;
use std::rc::Rc;
pub fn decode_hex(s: &str) -> Result<Vec<u8>, ParseIntError> {
[Stylesheet (5)]
[AtRule] name: media
[MediaQueryList (2)]
[MediaQuery] modifier: only media_type: screen
[Condition (1)]
[Feature] kind: Media name: -webkit-min-device-pixel-ratio
[Number] 1.25
[MediaQuery] modifier: only media_type: screen
[Condition (1)]
[Feature] kind: Media name: min-resolution
@jaytaph
jaytaph / ChoiceTypeWithAttr.php
Last active May 14, 2023 10:47
Choice Type with help texts per option
<?php
namespace App\Form;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ChoiceTypeWithAttr extends ChoiceType
package middleware
func (*JWTToken) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
tmp := mux.Vars(r)
// tmp is nil
// Do stuff
next(w, r)
}