Skip to content

Instantly share code, notes, and snippets.

View tacryt-socryp's full-sized avatar
🌊

tacryt-socryp tacryt-socryp

🌊
View GitHub Profile
!.
=> ~ =>
|%
++ add
|= [a=@ b=@]
^- @
?: =(0 a) b
$(a (dec a), b +(b))
::
++ sub
@tacryt-socryp
tacryt-socryp / webpack.config.js
Created October 13, 2021 23:41
webpack for @urbit/http-api
module.exports = {
entry: ['./dist/index.js'],
output: {
filename: 'bundle.js'
},
resolve: {
fallback: { http: require.resolve('stream-http') }
}
};
|merge %suite our %base, =gem %init
|mount %suite
cd ~/dev/urbit/pkg
./symbolic-merge.sh ./arvo ./market
./symbolic-merge.sh ./garden-dev ./market
cp -RL ./market/* ~/fakenet/zod/suite
@tacryt-socryp
tacryt-socryp / graph-search.hoon
Created March 2, 2021 17:52
Graph store naive full-text string search
/- spider
/+ strandio, store=graph-store, graph
=, strand=strand:spider
^- thread:spider
|= arg=vase
=/ m (strand:spider ,vase)
^- form:m
=+ !<([~ qry=tape] arg)
~& > "searching all graphs"
=* orm orm:store
|%
+$ resource [=entity =term]
+$ resources (set resource)
::
+$ entity
$% [%ship =ship]
[%ships ships=(set ship)]
:: [%ring ...]
==
::
/- *post
|%
+$ streams
$: feeds=(map resource feed)
tags=(set term)
tag-queries=(map term resources)
==
::
+$ feed (ordered-map time post)
+$ action
/- *post
|%
+$ network
$: graphs=(map resource (unit graph))
tags=(set term)
tag-queries=(map term resources)
==
::
+$ graph (ordered-map time node)
+$ node [=post replies=(unit graph)]
|%
+$ resource [=ship =term]
+$ groups (map resource group)
+$ tag-queries (map term (set ship))
+$ group
$: all-members=(set ship)
=tag-queries
=policy
==
::
@tacryt-socryp
tacryt-socryp / associate-groups-permissions.hoon
Created August 14, 2019 18:47
UP: Userspace architecture example
:: hooks/associate-groups-permissions.hoon
|%
+$ state
$% [%0 state-zero]
==
::
+$ group-path path
+$ permission-path path
::
+$ state-zero
@tacryt-socryp
tacryt-socryp / synapse.hoon
Last active August 2, 2019 22:52
Synapse application sketch
/+ *synapse
::
|_ [bol=bowl:gall sta=state]
::
++ this .
::
++ prep
|= old=(unit state)
^- (quip move _this)
?~ old