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 / 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"
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
(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
+-----------------------------+
| |
| |
| |
+---------------^+ +---------+
| read | Land of purity | write |
| | | |
| | | |
| | | |
| +-----------------------------+ |
@yrashk
yrashk / es4j.md
Last active October 30, 2016 04:53
@yrashk
yrashk / User.java
Last active April 12, 2016 23:46
Pseudocode-ish User's email retrieval
// Pseudocode-ish User's email retrieval
public class User {
public String email() {
return query(equal(EmailChanged.ID, id),
descending(EmailChanged.TIMESTAMP)).first().
email();
}
}
@yrashk
yrashk / gist:bc9e2d3a0c6c0c33bebc18113eb3b282
Created April 3, 2016 16:46 — forked from knu/gist:111055
How to mass-rename tags and push them with Git
# Rename tags named foo-bar-#.#.# to v#.#.# and push the tag changes
git tag -l | while read t; do n="v${t##*-}"; git tag $n $t; git push --tags ; git tag -d $t; git push origin :refs/tags/$t ; done
@yrashk
yrashk / OFFER.md
Last active October 1, 2015 05:46
We will document, design and produce API bindings for all popular languages

Implementable

API Accessibility Program

TL;DR: We will document, design and produce API bindings for all popular languages.


Somebody once said, "good APIs are like good jokes — you don't need to explain them."

Verifying that +yrashk is my Bitcoin username. You can send me #bitcoin here: https://onename.io/yrashk