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 / es4j.md
Last active October 30, 2016 04:53
+-----------------------------+
| |
| |
| |
+---------------^+ +---------+
| read | Land of purity | write |
| | | |
| | | |
| | | |
| +-----------------------------+ |
(Finds the last element in an ordered collection: )
[2DUP CONCAT SWAP DROP CURSOR DUP ROT CURSOR/SEEK? [DUP CURSOR/CUR UNWRAP DROP ROT DUP LENGTH SWAP ROT ROT 0 SWAP SLICE EQUAL? [CURSOR/CUR] [CURSOR/PREV] IFELSE ] [CURSOR/LAST SWAP DROP] IFELSE UNWRAP SWAP DROP] 'ORDCOLL/LAST DEF
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
Compiling pumpkindb v0.2.0 (file:///Users/yrashk/Code/eventsourcing/pumpkindb)
warning: you should put `PumpkinScript` between ticks in the documentation
--> src/script/mod.rs:9:5
|
9 | //! PumpkinScript is a minimalistic concatenative, stack-based language inspired
| ^^^^^^^^^^^^^
|
= note: #[warn(doc_markdown)] on by default
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#doc_markdown
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"
@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
@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)
$ ./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
#! /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}"
@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;