Skip to content

Instantly share code, notes, and snippets.

@joshsh
joshsh / gist:c760559a736158a42f4063b264b90935
Last active June 20, 2024 18:38
OpenCypher feature template (YAML)
aggregate:
avg: false
collect: false
count: false
max: false
min: false
sum: false
arithmetic:
divide: false
minus: false
@joshsh
joshsh / gist:920c77dbc15aa2169d66ce68a37f71cb
Last active June 20, 2024 18:40
OpenCypher feature model (Protobuf)
// A model for characterizing OpenCypher queries and implementations in terms of included features.
//
// Note: this is an automatically generated file. Do not edit.
syntax = "proto3";
package hydra.langs.cypher;
option java_multiple_files = true;
option java_package = "hydra.langs.cypher";
// A model for characterizing OpenCypher implementations in terms of supported features.
//
// Note: this is an automatically generated file. Do not edit.
syntax = "proto3";
package hydra.langs.cypher;
option java_multiple_files = true;
option java_package = "hydra.langs.cypher";
@joshsh
joshsh / Ripple.hs
Last active April 23, 2018 16:41
The basic Ripple interpreter, in Haskell
{-
:! ghc -c SmSn/Ripple.hs
:load SmSn/Ripple
SmSn.Ripple.main
Examples:
reduce 1 [Do, dup, string "foo"]
reduce 1 [Do, plus, int 2, int 3, int 42]
@joshsh
joshsh / Activity.hs
Created April 23, 2018 00:19
Bayesian walks from SmSn activity logs
{-
:! ghc -c SmSn/Activity.hs
:load SmSn/Activity
SmSn.Activity.main
-}
module SmSn.Activity where
import SmSn.Bayesian
@joshsh
joshsh / Bayesian.hs
Last active April 23, 2018 00:28
Fun with Haskell and Bayesian networks
{-
Prerequisites:
cabal install random
cabal install MonadRandom
cabal install split
Text, e.g.:
cat /Users/josh/copy/humor/douglas_adams/hhgttg/book1.txt | grep -v "=\|Chapter" | tr '\r\n\t\"' ' ' | sed 's/ */ /g' > /tmp/bayes-play.txt
@joshsh
joshsh / gist:7d19bd4cf18abd33b0665ffa33476e5b
Created December 17, 2017 01:46
SmSn v2 syntax example: notes from a book
* Synesthesia: A Union of the Senses
as book:
author: Richard E. Cytowic
chapter: Introduction
section: Historical Developments
note:
* the emotion-color synesthesia noted by Cytowic
* "Cytowic has found examples of people in whom extreme emotions can be the trigger, so that anger, kissing, or even orgasms can release shapes, textures, or colors"
section: Criticism of Experiential Responses
section: Synesthetes as Cognitive Fossils
children:
-
id: foobar
-
id: quuxly
created: 1487976536438
id: jrWpedhT8hjABdhJ
text: |-
This is multiline text.
Newlines are escaped.
@joshsh
joshsh / gist:2b635493171857df18419ddd1cc8ddb4
Created August 1, 2017 19:25
find SmSn files with problematic verbatim blocks
for file in `find . -name "*.smsn"`; do echo $file" "$(grep -c "\`\`\`" $file); done
#!/bin/bash
ls | grep "^................$" > /tmp/files
for i in `cat /tmp/files`; do git mv $i $i.smsn; done