Skip to content

Instantly share code, notes, and snippets.

View jonathontoon's full-sized avatar
🏴

Jonathon Toon jonathontoon

🏴
View GitHub Profile
@jonathontoon
jonathontoon / sudoku.js
Created December 15, 2023 02:49
Sudoku Generator
/**
* Sudoku Puzzle Generator Module
*/
const SudokuPuzzle = (() => {
/**
* Generates a blank Sudoku board of given size.
* @param {number} size - The size of the Sudoku puzzle, along one axis.
* @returns {number[][]} A two-dimensional array representing the Sudoku board.
*/
const generateBoard = (size) => {
@jonathontoon
jonathontoon / getAllPrices.js
Created August 25, 2022 10:15
Script for pulling all prices for Japanese Mega Drive games from PriceCharting.com
function getAllPrices(platform = "jp-sega-mega-drive") {
const cursors = [0, 50, 100, 150, 200, 250, 300, 350, 400];
const productData = [];
cursors.forEach(function (cursor) {
const response = UrlFetchApp.fetch(`https://www.pricecharting.com/console/${platform}?sort=name&genre-name=&cursor=${cursor}&exclude-variants=false&exclude-hardware=false&format=json`);
const parsedData = JSON.parse(response.getContentText());
parsedData["products"].forEach(function (product) {
let productName = product.productName;
productName = productName.replace("Gleylancer [Reprint]", "Gleylancer Reprint");
@jonathontoon
jonathontoon / level.ts
Last active June 30, 2022 08:57
WASM4 Game Progress
import * as g from "./globals";
import Tile from "./tile";
import Point from "./point";
import { getNeighboringPoints, getRandomPoint, inBounds } from "./helpers";
class Level {
private size: i32 = 20;
@jonathontoon
jonathontoon / python
Last active November 21, 2021 09:48 — forked from iam4722202468/python
Free Flow Puzzle Generator
import random
paths = {}
MINIMUM_LINE_SIZE = 3
SIZE = 7
def printPuzzle():
puzzle = []
@jonathontoon
jonathontoon / concentric.p8
Created October 16, 2021 02:29
Concentric circles visualization used for a profile photo.
colors={1,12,3,11,10,9,4,2,8,14,7,6,0}
function _draw()
cls(1)
for i=1,13,1 do
local y=64+(i*4)-8
local r=58-(i*4)
if r==0 then
r=2
@jonathontoon
jonathontoon / pico-spiral.p8
Created October 11, 2021 10:31
A quick spiral visualization. Written in Lua for PICO-8.
pico-8 cartridge // http://www.pico-8.com
version 33
__lua__
function _init()
frme=0
pi=3.141592653589793
cx=64
cy=64

Keybase proof

I hereby claim:

  • I am jonathontoon on github.
  • I am jonathontoon (https://keybase.io/jonathontoon) on keybase.
  • I have a public key ASAPixjZ00_Euizo-VBTAPH_JdsUE1cCKBDS-tKeAT4GUQo

To claim this, I am signing this object:

@jonathontoon
jonathontoon / main.js
Last active December 11, 2019 05:56
navaid, redux, jsx
...
import navaid from "navaid";
import Route1 from "./routes/Route1";
import Route2 from "./routes/Route2";
import store from "./redux/store";
const router = navaid();
@jonathontoon
jonathontoon / ListComponent.js
Last active October 20, 2019 03:08
Sorting List
import List from "./List";
import ListItem from "./ListItem";
const ListComponent = ({ unsortedItems }) => {
const sortedItemsByAscending = unsortedItems.sort((a, b) => {
return a.value > b.value;
});
return (
import SocketManager from "./socketManager";
import http from "http";
import express from "express";
import cors from "cors";
import path from "path";
import SocketIO from "socket.io";
import helmet from "helmet";
import compression from "compression";
import dotenv from "dotenv";