Skip to content

Instantly share code, notes, and snippets.

View triptych's full-sized avatar
💭
Making web things

Andrew Wooldridge triptych

💭
Making web things
View GitHub Profile
<html>
<div><b> This is a gist !</b></div>
<div><i> This is from a new version </i></div>
<div><a href="https://observablehq.com/@triptych/rendering-html-from-a-github-gist">Here's a link back to the Observable Notebook. From the Github gist.</a></div>
</html>
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
<h1> A test Gist </h1>
@triptych
triptych / readme.txt
Created September 27, 2020 07:05
a test gist!
Some stuff! please work! Sun Sep 27 2020
@triptych
triptych / app.js
Created September 26, 2020 21:53 — forked from JuanJo4/app.js
Twitter OAuth with node-oauth for node.js + express 4
/*
Node.js, express, oauth example using Twitters API
Install Dependencies:
npm install express
npm install oauth
Create App File:
Save this file to app.js
@triptych
triptych / game.txt
Created September 26, 2020 16:54
tinychoice game
{"START":[["You stand between a field of sheep and a field of cows."],[""],["You wonder what the cows are up to, but you can't figure it out."],[""],["Go to the cows","COWFIELD"],["Go to the sheep","SHEEPFIELD"],[""]],"__STARTSECTION__":"START","COWFIELD":[["Cows are rolling about."],[""],["Roll with the cows","COWFIELD2"],["Leave this place","START"],[""]],"COWFIELD2":[["You roll around for a bit, but you don't feel that you really fit in here."],[""],["Leave this place","START"],[""]],"SHEEPFIELD":[["Sheep are jumping up and down"],[""],["Jump with the sheep","SHEEPFIELD2"],["Leave this place","START"],[""]],"SHEEPFIELD2":[["You jump up and down, just like the sheep, but however hard and long you try they still look at you differently."],[""],["Leave this place","START"],[""]]}
@triptych
triptych / game.txt
Created September 26, 2020 16:48
tinychoice game
{"START":[["You stand between a field of sheep and a field of cows."],[""],["You wonder what the cows are up to, but you can't figure it out."],[""],["Go to the cows","COWFIELD"],["Go to the sheep","SHEEPFIELD"],[""]],"__STARTSECTION__":"START","COWFIELD":[["Cows are rolling about."],[""],["Roll with the cows","COWFIELD2"],["Leave this place","START"],[""]],"COWFIELD2":[["You roll around for a bit, but you don't feel that you really fit in here."],[""],["Leave this place","START"],[""]],"SHEEPFIELD":[["Sheep are jumping up and down"],[""],["Jump with the sheep","SHEEPFIELD2"],["Leave this place","START"],[""]],"SHEEPFIELD2":[["You jump up and down, just like the sheep, but however hard and long you try they still look at you differently."],[""],["Leave this place","START"],[""]]}
Link to raytracing example at gifboy.io
Adapter from Yonaba's lua raytracer example
https://gifboy.io/map=%7B%0Awidth=10,%0Aheight=10,%0A%7B1,0,0,0,1,1,1,1,1,1%7D,%0A%7B1,0,0,0,0,0,0,0,0,1%7D,%0A%7B1,0,0,0,0,0,0,0,0,1%7D,%0A%7B1,0,0,0,0,0,0,0,0,1%7D,%0A%7B1,0,0,0,0,0,0,0,0,1%7D,%0A%7B1,0,0,0,1,0,0,0,0,1%7D,%0A%7B1,1,0,0,1,1,0,0,0,1%7D,%0A%7B1,0,0,0,1,0,0,0,0,1%7D,%0A%7B1,1,0,0,1,1,0,0,0,1%7D,%0A%7B1,1,1,1,1,1,1,2,2,1%7D%0A%7D%0A%0Aposx=1%0Aposy=3%0Adirx=1%0Adiry=0%0Aplanex=0%0Aplaney=0.66%0Amove=.2%0Arotation=math.pi/2%0Adirection=1%0Ascreenx=160%0Ascreeny=160%0AcolorRoof=6%0AcolorSky=5%0AcolorStripes=10%0A%0A--3d%20loop%0Adelay(150)%0Afor%20i=1,24%20do%0Aclear()%0Ax=0%0Afor%20x=0,screenx%20do%0Acamx=2*x/screenx-1%0Arayposx=posx%0Arayposy=posy%0Araydirx=dirx+planex*camx%0Araydiry=diry+planey*camx%0Amapx=rayposx%0Amapy=rayposy%0Asidedistx=0%0Asidedisty=0%0Adeltadistx=math.sqrt(1+(raydiry*raydiry)/(raydirx*raydirx))%0Adeltadisty=math.sqrt(1+(raydirx*raydirx)/(raydiry*raydiry))%0Aperp=0%0Astepx=0%0Astepy=0%0Ahi
<script context="module">
export async function preload({ params, query }) {
// the `slug` parameter is available because
// this file is called [slug].svelte
const res = await this.fetch(`_posts/${params.slug}.md`);
if (res.status === 200) {
return { postMd: await res.text() };
} else {
this.error(res.status, data.message);
@triptych
triptych / fetch-api-examples.md
Created August 23, 2020 07:34 — forked from justsml/fetch-api-examples.md
JavaScript Fetch API Examples