Skip to content

Instantly share code, notes, and snippets.

Avatar

Kris Kowal kriskowal

View GitHub Profile
View edlin.lobster
import std
import color
import vec
let fontsize = 40
let cursor = xy{ 4, fontsize }
let cursor_hz = 2
fatal(gl_window("edlin", 800, 800))
View peruacru-privacy-policy.md

Privacy Policy

Kris Kowal built the Peruacrú app as an open source app. This SERVICE is provided by Kris Kowal at no cost and is intended for use as is.

This page is used to inform visitors regarding our policies with the collection, use, and disclosure of Personal Information if anyone decided to use our Service.

@kriskowal
kriskowal / wanderingents.lobster
Created Nov 5, 2019
Wandering Ents Lobster Proof of Concept
View wanderingents.lobster
import gui
import texture
def scatter(dst, src, stencils):
for(stencils) stencil, i:
for(stencil) j, k:
dst[i][k] = src[j]
def gather_intents(intents, neighborhoods, ents):
for(neighborhoods) neighbors, i:
@kriskowal
kriskowal / runes.go
Created Feb 2, 2019
Generate tables for converting an image describing line art into the corresponding runes.
View runes.go
package main
var lineArtRuneOffsets = []uint8{
// Index NnSsEeWs NnSsEeWw Rune
0x00, // 00000000 -------- " "
0x01, // 00000001 -------w "╴"
0x01, // 00000010 -------w "╴"
0x10, // 00000011 ------W- "╸"
0x02, // 00000100 -----e-- "╶"
0x03, // 00000101 -----e-w "─"
View peruacru.js
// @generated
/*eslint semi:[0], no-native-reassign:[0]*/
global = this;
(function (modules) {
// Bundle allows the run-time to extract already-loaded modules from the
// boot bundle.
var bundle = {};
var main;
@kriskowal
kriskowal / kni-markdown-style.md
Last active Dec 12, 2018 — forked from snowyu/kni-markdown-style.md
The new style markdown KNI
View kni-markdown-style.md

Starting with @snowyu’s proposal I infer some design principles:

  1. This language is designed to be easy to render using existing Markdown, YAML, and syntax highlighters.
  2. The language should break out to TypeScript that is evaluated in the scope of a global object that represents all of the play state.
  3. The Markdown script is a Markdown subset that uses inline backtick expressions to break out to an annotation language that carry semantics.
  4. The annotation language embeds the TypeScript grammar for evaluating expressions.

My iteration on this design adds some detail:

  1. We use a Markdown variant that forbids arbitrary HTML, adds semantics to list item notation, and uses backticks for annotations.
@kriskowal
kriskowal / archery.knit
Last active Dec 12, 2018
I wonder whether I could make this language work.
View archery.knit
- TYPE ITEMTYPE:
- A: THREAD
- ONE: THREAD
- MANY: THREAD
- TYPE ITEM:
- TYPE: ITEMTYPE
- COUNT: NUMBER
- ITEMTYPE ARROWTYPE:
- A: an
View 0-usage.js
idle.then(series([
delay(1000),
() => console.log('A'),
parallel([
series([delay(333), () => console.log('1/3')]),
series([delay(666), () => console.log('2/3')]),
series([delay(999), () => console.log('3/3')]),
]),
delay(1000),
() => console.log('B'),
View shortest-paths.bash
#!/bin/bash
jq -Rr 'split(",")' | jq -scr '
def table_to_edges: . as [$src, $dst, $weight] |
{$src, $dst, weight: $weight | tonumber};
def edges_to_table: . as {$src, $dst, $weight} |
[$src, $dst, $weight];
def graph_to_edges:
View shortest-paths.bash
#!/bin/bash
jq -Rr 'split(",")' | jq -scr '
def table_to_edges: . as [$src, $dst, $weight] |
{$src, $dst, weight: $weight | tonumber};
def edges_to_table: . as {$src, $dst, $weight} |
[$src, $dst, $weight];
def graph_to_edges:
You can’t perform that action at this time.