Skip to content

Instantly share code, notes, and snippets.

View JoshuaGrams's full-sized avatar

Joshua Grams JoshuaGrams

  • Vienna, Maine, USA
View GitHub Profile
@JoshuaGrams
JoshuaGrams / reveal.tw
Last active April 2, 2024 08:26
Line-by-line text reveal: Twine/SugarCube.
:: Some Passage
This will show at the start.
@@.hide;This will show after you click or press space/enter.@@
@@.hide;.nocontinue;This will show after you advance again, but will <em>not</em> have the continue marker.@@
<span class="hide">HTML tags work fine too, but the other notation is shorter.</span>
{
"origin":["#noggin##slog#"],
"noggin":["head","beezer","noggin","skull","scalp","pate","poll","noodle","block","noddle","mazard","occiput","dome","nut","helm","brain","mind","cerebrum","psyche","mind","bean","conk"],
"slog":["heck","slog","bleh","bleck","eep","geez","gah","derp","tosh","feh","ack","bah","rat","nuts","crud","rust","rant","twit","herd","goof","gape","flout","foist","flop","lord","load","fake","sack","zooks","knocker","zoinks","wit","tastic","end","botch","chump","scut","dish","plod","drudge","grub","moil"]
}

The conversation system from Glass by Emily Short

A quick code walkthrough by Josh Grams

This is actually pretty straightforward: it's just very spread out and there's a lot of boilerplate directing everything you type to the conversation system, so it's easy to miss the important parts.


@JoshuaGrams
JoshuaGrams / N.js
Created November 2, 2022 23:31
Creating/modifing DOM [N]odes.
// ---------------------------------------------------------------------
// N: (Node) Add attributes, properties, and children to a DOM node
// (possibly creating it first).
// args:
// target: an Element or a tag name (e.g. "div")
// then optional in any order (type determines function)
// Element: child
// string: text node child
// array: values are treated as args
// null/undefined: ignored
@JoshuaGrams
JoshuaGrams / Install Tweego 2.1.1 on OSX.md
Last active September 2, 2022 16:24 — forked from jsoma/README.md
Installing tweego and story-formats on OS X.

To download and run this script in a single command, cut and paste this in Terminal:

curl https://gist.githubusercontent.com/JoshuaGrams/845eb0e0cd8e8fb42668028792b37ce7/raw/f7de596a50eff8734483c560560ef441a9f26c33/tweego.sh | bash

Do you have reading recommendations about the science and ecology of farming? Where can a beginner explore these interdependencies you've mentioned?

For vegetable gardening, Eliot Coleman's [New Organic Grower][] is a classic talking about how to design and run a small vegetable operation. He's insatiably curious and he's trying to give you the tools you need to make your own decisions for your own situation rather than giving you a concrete recipe that may quickly become outdated.

@JoshuaGrams
JoshuaGrams / docs.md
Last active November 17, 2021 05:57
Single stroke navigation and key combos

This is sort of a blend between Ted Morin's excellent cross platform movement dictionary and codepoke's single stroke commands dictionary.

I've been using it intermittently for a couple weeks and I'm happy with it. I'm still slow because I haven't practiced it and don't actually use it much, but I've found it easy to remember what the strokes are, and most of the modifier combos are pretty comfortable for me.

It uses STK to indicate a navigation command on the right, and then P/W/H/R are Super, Control, Alt, and Shift, respectively. You can use these by themselves to press and release the bare modifier (e.g. Super to open the Windows menu, Alt to toggle application menus).

This is mirrored on the right by -LGT, and P/B/F/R are Super/Control/Alt/Shift. Combine this with a fingerspelt letter for key combos. I did not define these alone: they

@JoshuaGrams
JoshuaGrams / outline-numbers.json
Last active November 9, 2021 22:50
Phoenix-style outline numbers
{
"SWRAOER": "0",
"WUPB": "1",
"TWO": "2",
"THRAOE": "3",
"TPOUR": "4",
"TPAOEUFB": "5",
"SEUBGS": "6",
"SAEFB": "7",
"AEUGT": "8",
@JoshuaGrams
JoshuaGrams / a-readme.md
Last active August 15, 2021 11:13
Bundle javascript inline into html files

Put into your source directory. Run with node bundle-scripts.js on the command line. You can probably put the command into a .bat file (Windows) or .sh file (Mac OSX, Linux) so you can just double-click it to build?

@JoshuaGrams
JoshuaGrams / main.js
Last active May 5, 2021 12:50
Extremely basic storylets in Ink
(function(storyContent) {
var story = new inkjs.Story(storyContent);
var storyContainer = document.querySelectorAll('#story')[0];
function showAfter(delay, el) {
setTimeout(function() { el.classList.add("show") }, delay);
}