Skip to content

Instantly share code, notes, and snippets.

@stackdump
stackdump / Metamodel.sol
Created June 2, 2023 00:42
Metamodel implementation in solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import "@openzeppelin/contracts/access/AccessControl.sol";
contract MetamodelUint8 {
Place[] internal places;
Transition[] internal transitions;
struct PetriNet {
@stackdump
stackdump / Metamodel.sol
Created May 25, 2023 15:04
metamodel POC (WIP)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
// Uncomment this line to use console.log
// import "hardhat/console.sol";
// see also: bitwrap.io: where we are developing a generalized state channel for web3
contract Metamodel {
address payable public owner;
@stackdump
stackdump / generate_data.py
Created February 11, 2023 19:51
pflow-tensors
import math
import random
import torchflow
import torch
import examples.tictactoe
win_moves = [
["00", "01", "02"],
@stackdump
stackdump / backup_world.sh
Created March 8, 2022 16:09
snapshot Minetest world with IPFS
#!/usr/bin/env bash
# backup world in IPFS
cd "${BASH_SOURCE%/*}" || exit
ROOT='vevr.se'
WORLD="foo7"
TS=$(date +%s)
@stackdump
stackdump / hello.py
Created September 11, 2020 17:34
Draw on 2.7 in e-ink raspberry pi hat
#!/usr/bin/python
# -*- coding:utf-8 -*-
import sys
import os
picdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'pic')
libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib')
if os.path.exists(libdir):
sys.path.append(libdir)
import logging
package pubsub_test
import (
"github.com/FactomProject/factomd/common/constants"
"github.com/FactomProject/factomd/common/interfaces"
"github.com/FactomProject/factomd/common/messages"
. "github.com/FactomProject/factomd/pubsub"
"testing"
"time"
)
#!/usr/bin/env sh
torsocks curl -X POST \
--data-binary '{"jsonrpc": "2.0", "id": 0, "method": "current-minute"}' \
-H 'content-type:text/plain;' http://mainnetp24u4y4vsuvspeotbhpnmupmpnwfjzmfzfyuvstuqs572buqd.onion/v2
#!/bin/sh
# Copyright 2012 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# git gofmt pre-commit hook
#
# To use, store as .git/hooks/pre-commit inside your repository and make sure
# it has execute permissions.
#
# This script does not handle file names that contain spaces.
package log
import (
"context"
"fmt"
"io"
opentracing "github.com/opentracing/opentracing-go"
jaeger "github.com/uber/jaeger-client-go"
config "github.com/uber/jaeger-client-go/config"
@stackdump
stackdump / bench.txt
Created September 25, 2019 13:25
Pegnet Hash benchmark using GOARCH=arm64 on Jetson nano and go 1.13
Writing ByteMap Table
Finished Reading ByteMap Table. Total time taken: 26m23.939530035s
Hash Init = fafaececfafaecec, 30, 256, 5
CPU = ARMv8 Processor rev 1 (v8l)
Cores = 4
Total RAM = 3956 MB
OS = linux
Platform = ubuntu
=====================================
Running 60 second test with 1 miners: 59s