Skip to content

Instantly share code, notes, and snippets.

mkdir tnr-mws-test
cd tnr-mws-test
git clone https://github.com/PotOfCoffee2Go/TiddlyWiki5.git --branch multi-wiki-startup
cd ./TiddlyWiki5
npm install
cd ..
git clone https://github.com/PotOfCoffee2Go/tw5-node-red-beta.git --branch mws-interface
@PotOfCoffee2Go
PotOfCoffee2Go / 00-getBagRecentTiddlers.md
Last active March 19, 2024 14:07
Proposed getBagRecentTiddlers() database function

The Purpose of $tw.mws.store.getBagRecentTiddlers(bag_name, greater_than_tiddler_id, limit) is to be able to poll the MWS tiddler database for new and updated tiddlers.

These are the current tiddlers in 'bag-alpha':

$tw.mws.store.getBagTiddlers('bag-alpha')

[
  { title: '$:/SiteTitle', tiddler_id: 18943 },
  { title: 'In the bag', tiddler_id: 13264 },
@PotOfCoffee2Go
PotOfCoffee2Go / $__poc2go_modules_commands_repl.js
Created November 17, 2023 05:02
TW5 modules to implement REPL
created: 20231116150029494
modified: 20231117043247159
module-type: command
tags:
title: $:/poc2go/modules/commands/repl.js
type: application/javascript
/*\
title: $:/poc2go/modules/commands/repl.js
type: application/javascript
@PotOfCoffee2Go
PotOfCoffee2Go / Hello World.json
Last active August 22, 2023 20:12
Demo of TW5-Node-Red fetch
{"title": "Hello World!",
"text": "This tiddler is a gist on github at https://gist.github.com/PotOfCoffee2Go/160f247423751b317b704a1063d8aed6/raw/Hello World.json"
}

Draft


Welcome to PotOfCoffee2Go Chat Service.

This chat software service was made to bring chat into the modern day realm of messages contructed with HTML, Markdown, and just plain text - if you must ;)

The server is based on [Expressjs][1], (maybe should refactor to [Koa??][2]) The server only has the concept of rooms. There are no users, or groups, or any other entites to clutter the basics of a chat service.

@PotOfCoffee2Go
PotOfCoffee2Go / _Observe_GOL.md
Last active October 31, 2020 14:28
Documentation for observablehq.com game of life

Documentation for Game of Life page

@PotOfCoffee2Go
PotOfCoffee2Go / cellular automata RLE parser.md
Last active March 15, 2024 08:52
Javascript cellular automata RLE parser

RLE parser usage

See the RLE section for definition of RLE format.

This class expects the (extended) RLE input to be correctly formatted. It is a two state parser, thus multi-state RLE will not parse properly.

The output this.pattern is a string with spaces(dead)/zero(alive) with lines separated by '\n'.

@PotOfCoffee2Go
PotOfCoffee2Go / _automaton.md
Last active June 15, 2020 20:55
Javascript Cellular Automaton Engine

_conway_life

  • Press 'raw' button of the _index.html file below

  • Copy the file (ctrl-a)(ctrl-c)

  • Paste into fav editor (ctrl-v) and save (ctrl-s).

    • (Name can be anything but should have a '.html' extension)
  • Open in browser - no server needed.

    • (The other files in this gist will be automatically fetched)
@PotOfCoffee2Go
PotOfCoffee2Go / colorconsole.js
Created May 12, 2020 09:51
Linux bash color console in nodejs
/*
Allows coloring linux console text with nodejs.
Color codes are loaded into a table of 8 rows
with each row containing 64 columns.
Examples:
Save this file as 'colorconsole.js'
then run 'node ./colorconsole.js'
Usage:
@PotOfCoffee2Go
PotOfCoffee2Go / store.js
Last active March 26, 2020 15:54
Persist values between web pages in localstorage
/*
Persist values between web pages in localstorage
Handles data objects to any depth
usage:
let store = new Store;
let value = store.db.path.to.field.value;
store.update = {section: {field: value}};
*/
class Store {
constructor() { this.init(); }