Skip to content

Instantly share code, notes, and snippets.

@stackdump
stackdump / tic-tac-toe-expert-system.ipynb
Created December 31, 2024 13:44
use tic-tac-toe petri-net model to predict win probability
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stackdump
stackdump / leader_election.md
Created December 21, 2024 20:12
Leader Election

A model of 3 node authority network

pflow

@stackdump
stackdump / tic-tac-toe-win-detection.ipynb
Last active December 31, 2024 14:47
Tic-tac-toe Model with win detection converted to ODE Problem for analysis - Part 2 of 2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stackdump
stackdump / tic-tac-toe-turn-taking.ipynb
Last active December 13, 2024 20:34
Tic-tac-toe Model converted to ODE Problem for analysis - Part 1 of 2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Manually Creating a Supabase User via Dockerized PostgreSQL

When working with Supabase, there may be situations where you need to manually create a database user for administrative tasks or specific workflows. This guide walks through the process using a Dockerized PostgreSQL instance, as typically deployed with Supabase.

Prerequisites

  • A working Supabase instance deployed via Docker.
  • Docker and Docker Compose installed on your system.
  • Basic familiarity with PostgreSQL commands.
@stackdump
stackdump / petri_net_state_machines_RFC.md
Created September 1, 2024 19:16
Petri-Net State Machine Proposed Standard - RFC
@stackdump
stackdump / pflow.html
Last active February 10, 2024 20:58
Run pflow.dev app from CDN
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<title>pflow.dev | metamodel editor</title>
<script defer="defer" src="https://cdn.jsdelivr.net/gh/pflow-dev/[email protected]/p/static/js/main.4602f11c.js"> </script>
<link href="https://cdn.jsdelivr.net/gh/pflow-dev/[email protected]/p/static/css/main.63d515f3.css" rel="stylesheet">
</head>
@stackdump
stackdump / Metamodel.sol
Last active July 14, 2023 14:39
Metamodel-v3
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import "@openzeppelin/contracts/access/AccessControl.sol";
// import "hardhat/console.sol";
library Uint8Model {
event Action(uint256 indexed session, uint8 indexed sequence, uint8 actionId, uint8 role, uint256 when);
struct PetriNet {
// REVIEW visual model design in JS:
// https://pflow.dev/chainlink2023/tictactoe/
contract TicTacToeModel is MetamodelUint8, Uint8ModelFactory {
enum Roles{ X, O, HALT }
enum Properties {
_00, _01, _02,
_10, _11, _12,
_20, _21, _22,