Skip to content

Instantly share code, notes, and snippets.

View yrashk's full-sized avatar
🎯
Being productive

Yurii Rashkovskii yrashk

🎯
Being productive
View GitHub Profile
@yrashk
yrashk / demo.sql
Last active October 28, 2023 16:07
Omnigres Python and Flask experience: Early Preview (Oct 23, 2023) https://www.loom.com/share/b4701cbc77e941919cd5dbff7b15465e
--- omni_schema[[ignore]]
---
--- NB: most, if not all of this will be handled by the upcoming [CLI] tooling
---
-- Extensions
create extension if not exists omni_schema cascade;
create extension if not exists omni_python cascade;
create extension if not exists omni_httpd cascade;
@yrashk
yrashk / requires.diff
Last active June 18, 2023 01:11
requires CE for CLIPS
commit 41434dc598adef1b1275966c70eb85a0e9caa5f6
Author: Yurii Rashkovskii <yrashk@gmail.com>
Date: Sat Jun 17 18:10:44 2023 -0700
Problem: forward chaining in CLIPS
This makes creating systems that drive for an outcome much more
difficult as forward chaining is inherently reactive and doesn't tell
the engine which facts would drive the rules to expected completion.
@yrashk
yrashk / 0_motd.sql
Last active March 23, 2023 03:39
A micro web app example for Omnigres (https://github.com/omnigres/omnigres) (README.md candidate)
create table if not exists motd
(
id int primary key generated always as identity,
content text,
posted_at timestamp default now()
);
create or replace function show_motd() returns setof omni_httpd.http_response as
$$
select
@yrashk
yrashk / SCM_RIGHTS.md
Created March 3, 2023 14:19 — forked from kentonv/SCM_RIGHTS.md
SCM_RIGHTS API quirks

As tested on Linux:

  • An SCM_RIGHTS ancillary message is "attached" to the range of data bytes sent in the same sendmsg() call.
  • However, as always, recvmsg() calls on the receiving end don't necessarily map 1:1 to sendmsg() calls. Messages can be coalesced or split.
  • The recvmsg() call that receives the first byte of the ancillary message's byte range also receives the ancillary message itself.
  • To prevent multiple ancillary messages being delivered
@yrashk
yrashk / api.cpp
Created March 3, 2023 14:18 — forked from RikkaW/api.cpp
Socket send fd
void api::OpenFiles(RiruFile *files, size_t count) {
struct sockaddr_un addr{};
int fd;
socklen_t socklen;
uint8_t *data;
uint32_t data_size;
int32_t reply[count];
uint32_t reply_size;
std::vector<int> fds;
#! /usr/bin/env bash
cfg=/tmp/sit-inbox.json
checkmark="✔"
echo Starting up sit-inbox
if [ -f /etc/sit-inbox/config.toml ]; then
echo "Reading config /etc/sit-inbox.toml"
toml2json /etc/sit-inbox/config.toml > "${cfg}"
$ ./target/release/sit issues
0a8e0da1-b747-4c22-811a-43c153d3e737
$ ./target/release/sit records 0a8e0da1-b747-4c22-811a-43c153d3e737
DAOXWMTMKEZCRSVV5IXQBDY676IR5SBV
$ ls -la .sit/0a8e0da1-b747-4c22-811a-43c153d3e737/DAOXWMTMKEZCRSVV5IXQBDY676IR5SBV/
total 20
drwxr-xr-x 3 yrashk users 4096 Jan 28 18:17 .
drwxr-xr-x 3 yrashk users 4096 Jan 28 18:17 ..
-rw-r--r-- 1 yrashk users 22 Jan 28 18:17 text
-rw-r--r-- 1 yrashk users 30 Jan 28 18:17 .timestamp
@yrashk
yrashk / osstoken.md
Last active February 10, 2022 04:04
OSS Token

Open Source Software Token[s]

The idea behind this is to research and experiment with "smart contract" funding for open source and free software.

  • Allow less-known developers / projects to earn the public's trust ("cautious funding" — helping them build a reputation of being able to deliver; mechanisms may vary. could be based on bounties [see below] or funds release confirmations if bounties are not suitable for any reason... or something else entirely)
  • Allow direct organization/person funding (simple token transfer)
  • Allow funding specific goals (bounties)
  • Allow branding [sub]tokens for a specific project (bragging, voting, other kinds of rights)
  • Allow continuous support pledges (recurring payments)
  • Allow nominees to exchange tokens for the amount they were originally bought for (backed by ETH, the funding is deposited through an ICO, or a series of offerings)
@yrashk
yrashk / viewdb_example.psc
Created June 23, 2017 05:16
This is a simplified example [attributes have unprefixed/unversioned names, etc] of ViewDB journalling
[
<b3da98d2-57cf-11e7-b564-6c4008925d80> -- fact ID
DUP "name" "something" 'INDEX/STRING (value => key component transformer) ATTR/ASSOC
DUP "tags" ["nature" "photo"] [] ATTR/ASSOCVAL ( associate value only, no index )
DUP "hasTag" "nature" 'INDEX/STRING ATTR/ASSOC
DUP "hasTag" "photo" 'INDEX/STRING ATTR/ASSOC
(the above tagging example can be simplified by adding some "list" primitives)
DUP "timestamp" HLC [] ATTR/ASSOCUNIQ (can't have more than 1 "timestamp" attribute indexed)
] WRITE
diff --git a/Cargo.toml b/Cargo.toml
index 0f50257..a72d1c1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -44,6 +44,7 @@ log = "0.3.6"
log4rs = { version = "0.6.1", features = ["toml_format"] }
serde_json = "0.9.8"
clap = "2.20.5"
+ordermap = "0.2.8"