Skip to content

Instantly share code, notes, and snippets.

View johnbeech's full-sized avatar
🔬
Experimenting

John Beech johnbeech

🔬
Experimenting
View GitHub Profile
View video-summary.md

This is an generated summary of AlexaDonne's video based on text from the video transcript passed to ChatGPT 3.5

Original video:

22 Amateur Writing Mistakes to Avoid: A Comprehensive Guide

Writing is a craft that takes time and practice to master. Whether you're just starting out or have been writing for a while, it's important to be aware of common mistakes that can hinder your progress. In this article, we'll delve into 22 of the worst amateur writing mistakes and provide insights on how to overcome them.

Introduction

View StringReplace.py
class StringReplace:
"""
String replace node
"""
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
"""
@johnbeech
johnbeech / README.md
Last active March 12, 2023 20:03
Creating a GoNorth REST Client in NodeJS (See: https://github.com/steffendx/GoNorth/issues/116)
View README.md

GoNorth JS API Client

  • Requires Node LTS (e.g. Node 18)
  • Install deps: npm install
  • Run node client.js
Hosting swagger file on http://localhost:7200/gonorth_swagger.json
Hosting swagger ui on http://localhost:7200/ui/
Proxying requests on http://localhost:7200/api/ to http://localhost:5000/api/
@johnbeech
johnbeech / endpoints-openapi.ts
Created March 8, 2023 10:47
Generate Open API spec from AWS API Gateway
View endpoints-openapi.ts
import path from 'node:path'
import { Duration } from 'aws-cdk-lib'
import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs'
import { Runtime } from 'aws-cdk-lib/aws-lambda'
import { Construct } from 'constructs'
import { PolicyStatement } from 'aws-cdk-lib/aws-iam'
export const createOpenAPILambda = (scope: Construct): NodejsFunction => {
const apiInformationPolicy = new PolicyStatement({
actions: ['apigateway:GET'],
View filterEmptyArrays.js
console.time('file')
console.log('Do the things')
const listToFilter = [3, 5, '', null, 'yes', 'keep']
const limit = 10000000
let filteredList
console.log('Array size:', listToFilter.length, listToFilter)
console.log('Iterations:', limit)
View MERMAID-COLOURS-DEMO.md
graph LR
  subgraph colours["Default Colours"]
    box["Source"]
    box --> thing["Target"]
  end
@johnbeech
johnbeech / matrix.js
Last active August 20, 2020 14:04
Turn a page into matrix scrolling code.
View matrix.js
var canvas = document.createElement('canvas')
document.body.appendChild(canvas)
canvas.style.position = 'absolute';
canvas.style.width = '100vw';
canvas.style.height = '100vh';
canvas.style.top = 0;
canvas.style.left = 0;
canvas.style.zindex = 100;
var ctx = canvas.getContext('2d');
var columns = [];
@johnbeech
johnbeech / run.js
Last active April 7, 2020 11:19
Multi-repo software dependency updater - for projects using node, npm, and github
View run.js
/*
## Software Dependency Updater
A self contained multi-repo software dependency updater script - for projects using node, npm, and github.
## Prerequisites
- node > 10
- npm > 6
@johnbeech
johnbeech / Factorio Map Exchange String
Created December 22, 2019 21:47
Water lands, no biters.
View Factorio Map Exchange String
>>>eNpjYBBk8GcAgwYHILbnYEnOT8xhYHCwZ2A44ADCXMn5BQWpR
br5RanIwpzJRaUpqbr5mUDFDAjFqXmpuZW6SYnFqSDToCbbc2QW5
eehm8BaXJKfhypSUpSaWgzSsHqVlh2I5i4tSszLLM2F6EXYw8DoG
HZtS0OLHAMI/69nUPj/H4SBrAdAdQ8YGGBWMzACxaCAUTY5P6+kK
D9Htzi1pCQzL90qNz+zuKS0KNUqKTOxmMNAz9QABFiTczLT0hgYF
ByB2AlkCiMjY7XIOveHVVPsGSFm6TlAGR+gIgeSYCKeMIafA04pF
RjDBMkcYzD4jMSAWFoCtAKqisMBwYBItoAkGRl7325d8P3YBTvGP
ys/XvJNSrBnNHQVeffBaJ0dUJId5HkmODFrJgjshHmFAWbmA3uo1
E17xrNnQOCNPSMrSIcIiHCwABIHvJkZGAX4gKwFPUBCQYYB5jQ7m
DEiDoxpYPAN5pPHMMZle3R/AAPCBmS4HIg4ASLAFsJdxghhOvQ7M
View Factorio Releases
0.17.23|Fri Mar 29, 2019 4:57 pm
0.17.22|Fri Mar 29, 2019 12:44 pm
0.17.21|Tue Mar 26, 2019 8:46 pm
0.17.20|Tue Mar 26, 2019 4:49 pm
0.17.19|Tue Mar 26, 2019 2:55 pm
0.17.18|Mon Mar 25, 2019 6:24 pm
0.17.17|Thu Mar 21, 2019 7:49 pm
0.17.16|Tue Mar 19, 2019 9:50 pm
0.17.15|Mon Mar 18, 2019 8:33 pm
0.17.14|Fri Mar 15, 2019 8:20 pm