Skip to content

Instantly share code, notes, and snippets.


Ian Bicking ianb

View GitHub Profile
ianb / llm_zork.txt
Created Nov 29, 2022
Zork LLM (GPT-3) first attempt...
View llm_zork.txt
## Zork being run by GPT-3...
ZORK I: The Great Underground Empire
Copyright (c) 1981, 1982, 1983 Infocom, Inc. All rights reserved.
ZORK is a registered trademark of Infocom, Inc.
Revision 88 / Serial number 840726
West of House
You are standing in an open field west of a white house, with a boarded front door.


This is imagining an API to understand other programs. These programs, either large or small, are called "thunks" here. This isn't exactly what a CS thunk means, but it's also not not what it means, so it seems like an OK word.

This is also related to Dataflow programming, where the containing environment manages these thunks and the flow of data between them.

Thunk static API

A thunk is typically some source code (though it could be something besides string code), but its internals are specific to that specific kind of code. From the outside there's a more normal representation:

View jupyter-weave.js
// An extension to evaluate `${Python}` in Markdown cells
define(["base/js/namespace"], function(Jupyter) {
function load_ipython_extension() {"rendered.MarkdownCell", (event, data) => {
let cell = data.cell;
});"kernel_ready.Kernel", () => {
View test-16.diff
diff --git a/browser/extensions/screenshots/bootstrap.js b/browser/extensions/screenshots/bootstrap.js
index d252588..800ad66 100644
--- a/browser/extensions/screenshots/bootstrap.js
+++ b/browser/extensions/screenshots/bootstrap.js
@@ -11,12 +11,18 @@ const { interfaces: Ci, utils: Cu } = Components;
XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
+XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
+ "resource://gre/modules/AppConstants.jsm");
View make-static-html.js
/** This file is used to turn the document into static HTML with no scripts
As a framescript this can access the document and its iframes without
cross-domain permission issues.
documentStaticData() is the main function that collects all the information
and returns a JSONable object.
This script also contains the infrastructure for communicating as a framescript
with lib/framescripter
View example.js
function onButtonClicked() {
console.log("yay, click!");
document.getElementById("button").addEventListener("click", function () {
TogetherJS.send({type: "myButtonClick"});
}, false);
TogetherJS.hub.on("myButtonClick", function () {
View package-count
$ cat packages.txt
ianb / tjs-bookmarklet
Created Oct 25, 2013
TogetherJS bookmarklet
View tjs-bookmarklet
class Detector:
def __init__(self):
self.detectors = []
self._pending = []
self.matches = []
def feed_input(self, obj, index):
"""After instantiating Detector and adding individual detector coroutines, call
feed_input(obj, index) over and over until you are done. You should end with a
sentinal obj. Look in .matches to get the results.
ianb / assert.js
Last active Dec 16, 2015
assert() for Javascript
View assert.js
function AssertionError(msg) {
this.message = msg || ""; = "AssertionError";
AssertionError.prototype = Error.prototype;
/* Call assert(cond, description1, ...)
An AssertionError will be thrown if the cond is false. All parameters will be logged to the console,
and be part of the error.