Skip to content

Instantly share code, notes, and snippets.

@shawnco
shawnco / depth-first-generated-maze.js
Last active May 7, 2022 23:35
Depth-first Javascript maze generation
/* Assumes HTML file with <canvas id='maze' width='500' height='500'></canvas>
Also assumes the body bg color is black, canvas bg color is white */
const UNIT = 25;
const GRID = 20;
class Cell {
constructor(x,y) {
this.x = x; this.y=y;
this.visited = false;
@shawnco
shawnco / index.html
Last active May 27, 2022 14:32
Collaborative Drawing App article, HTML skeleton
<html>
<head>
<title>Collaborative Drawing App</title>
</head>
<body>
<b>testing!</b>
</body>
</html>
@shawnco
shawnco / index.js
Last active May 27, 2022 14:39
Collaborative Drawing App article, Express skeleton
const express = require('express');
const bodyParser = require('body-parser');
const path = require('path');
const PORT = 3000;
const app = express();
app.use(bodyParser.json());
app.use(express.static(path.join(__dirname + '/../client')));
@shawnco
shawnco / index.html
Created May 27, 2022 15:48
Collaborative Drawing App files as of article 2
<html>
<head>
<title>Collaborative Drawing App</title>
<style type="text/css">
canvas {
border: 1px solid black;
}
.palette {
border: 1px solid black;
display: inline-block;
@shawnco
shawnco / index.html
Created May 28, 2022 00:53
Collaborative Drawing App files as of article 3
<html>
<head>
<title>Collaborative Drawing App</title>
<style type="text/css">
canvas {
border: 1px solid black;
}
.palette {
border: 1px solid black;
display: inline-block;
@shawnco
shawnco / index.html
Created May 28, 2022 22:43
Collaborative Drawing App files as of article 4
<html>
<head>
<title>Collaborative Drawing App</title>
<style type="text/css">
canvas {
border: 1px solid black;
}
.palette {
border: 1px solid black;
display: inline-block;
@shawnco
shawnco / index.html
Last active June 4, 2022 01:32
Collaborative Drawing App files as of article 6
<html>
<head>
<title>Collaborative Drawing App</title>
<style type="text/css">
canvas {
border: 1px solid black;
}
.palette {
border: 1px solid black;
display: inline-block;
@shawnco
shawnco / index.html
Created June 3, 2022 20:09
Collaborative Drawing App files as of article 7
<html>
<head>
<title>Collaborative Drawing App</title>
<style type="text/css">
canvas {
border: 1px solid black;
}
.palette {
border: 1px solid black;
display: inline-block;
@shawnco
shawnco / index.html
Created June 4, 2022 01:07
Collaborative Drawing App files as of article 8
<html>
<head>
<title>Basic Collaborative Drawing App</title>
<style type="text/css">
canvas {
border: 1px solid black;
}
.palette {
border: 1px solid black;
display: inline-block;
@shawnco
shawnco / config.json
Created July 6, 2022 00:25
Twitch Bot Idle Game section 1
{
"username": "shawntc",
"password": "oauth:xxxxxxxxxxxxx",
"channels": ["shawntc"]
}