Skip to content

Instantly share code, notes, and snippets.

View johnbeech's full-sized avatar
🔬
Experimenting

John Beech johnbeech

🔬
Experimenting
View GitHub Profile

Set VSCode Colour

A bash script that sets unique color schemes for VSCode workspaces, making it easy to visually identify which project you're working in at a glance.

Features

  • 🎨 12 subtle color presets - Professional colors that won't strain your eyes
  • 🎲 Random selection - Quick setup with --random
  • 🏷️ Emoji identifiers - Each color has a matching emoji in the window title
  • 📁 Git-aware - Automatically finds and uses your git root directory
@johnbeech
johnbeech / pr-check.yml
Last active August 14, 2024 21:03
Example test runner for node JS projects using GitHub actions.
name: Check PR
on:
pull_request:
branches:
- master
- main
jobs:
test:
name: Linting and Testing
runs-on: ubuntu-latest

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

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)

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
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'],
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)
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.
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
/*
## Software Dependency Updater
A self contained multi-repo software dependency updater script - for projects using node, npm, and github.
## Prerequisites
- node > 10
- npm > 6