View login.graphql
mutation {
login(username:"admin", password:"nooneknows") {
token
user { id }
}
}
# output
{
View template.org

Campaign Notes

startup

This section contains a named elisp babel-block called startup. This block will be executed anytime the campaign file is selected as the active campaign.

player characters

This section contains headings for each player character.

View range.el
(defun dnd-range--roll (from to)
(+ from (random (- to from -1))))
(defvar dnd-range--resolvers
'(("\\([0-9]+\\)\\([-]+\\)\\([0-9]+\\)" (lambda (&rest items) (/ (apply '+ items) (length items))))
("\\([0-9]+\\)\\([<]+\\)\\([0-9]+\\)" min)
("\\([0-9]+\\)\\([>]+\\)\\([0-9]+\\)" max)))
(defun dnd-range--low-match (content) (string-to-int (match-string 1 content)))
(defun dnd-range--high-match (content) (string-to-int (match-string 3 content)))
View math.el
(defun dnd-math--resolver (content)
(let* ((regex "[-+*)([:digit:]]+")
(matches (s-match regex content)))
(loop for match in matches
for result = (calc-eval match)
do (setq content (dnd-utils--replace-first content match result))
finally return content)))
View org-olp.org

org-olp

This module provides two useful public functions:

  • org-olp-select (file-name olp) olp denotes a heading in file-name and a list of children are presented for selection. Selection will navigate to the child header
  • org-olp-make-olp (file-name) User is prompted for headers in file-name, starting at top-level, until a header with no children is reached. An olp list is returned.
View weight.el
(defun decide-table-weights (choices)
(let (result)
(dolist (element choices result)
(if (listp element)
(let ((option (car element))
(weight (cdr element)))
(setq result (cons weight result)))
(setq result (cons 1 result))))))
View sieve.fsx
#!/usr/bin/env fsharpi
#I "../../../.nuget/packages/hopac/0.3.21/lib/net45/"
#I "../../../.nuget/packages/hopac.extras/0.3.1/lib/net45"
#r "Hopac.Extras"
#r "Hopac.Platform"
#r "Hopac.Core"
#r "Hopac"
open System
View _error
./2.5-sync-messages.fsx
Unhandled exception: System.ArgumentException: Cannot resolve method System.Object Specialize[b]() because the declaring type of the method handle FSI_0001+Buffer+full@31-1[a] is generic. Explicitly provide the declaring type to GetMethodFromHandle.
at System.Reflection.MethodBase.GetMethodFromHandle (System.RuntimeMethodHandle handle) [0x00072] in <ab2f5ad0f8c84dfe97dfd6a06a64cf44>:0
at System.Reflection.Emit.GenericTypeParameterBuilder.InternalResolve () [0x00019] in <ab2f5ad0f8c84dfe97dfd6a06a64cf44>:0
at System.Reflection.Emit.TypeBuilderInstantiation.InternalResolve () [0x0001e] in <ab2f5ad0f8c84dfe97dfd6a06a64cf44>:0
at System.Reflection.Emit.ConstructorOnTypeBuilderInst.RuntimeResolve () [0x00000] in <ab2f5ad0f8c84dfe97dfd6a06a64cf44>:0
at System.Reflection.Emit.ModuleBuilder.RuntimeResolve (System.Object obj) [0x00080] in <ab2f5ad0f8c84dfe97dfd6a06a64cf44>:0
at FSI_0001+Buffer.empty@29[a,b] (Hopac.Ch`1[T] insCh, Hopac.Ch`1[T] remCh, Microsoft.FSharp.Core.Unit unitVa
View 2.1-lock-and-wait.fs
#!/usr/bin/env fsharpi
#I "../../../.nuget/packages/hopac/0.3.21/lib/net45/"
#r "Hopac.Platform"
#r "Hopac.Core"
#r "Hopac"
open System.Collections.Generic
open Hopac
View utils.fs
// true if p for any two in hs
let exhaust p (hs:_ list) =
let rec outer (o:int) =
let rec inner (i:int) =
if i = hs.Length then
false
else
p hs.[o] hs.[i] || inner (i+1)
if o = hs.Length - 1 then