Skip to content

Instantly share code, notes, and snippets.

View GoodNovember's full-sized avatar
🖍️
Why can't I write my code in Crayon?

Victor GoodNovember

🖍️
Why can't I write my code in Crayon?
  • 951 Gaspra
View GitHub Profile
@GoodNovember
GoodNovember / help-fix-new-www-dump
Created May 22, 2024 20:05
We tried to dump the server, got an error instead.
[victor@ip-172-26-8-125 html]$ drush sql:sync @live @self --debug
[preflight] Config paths: /var/www/html/vendor/drush/drush/drush.yml
[preflight] Alias paths: /var/www/html/web/drush/sites,/var/www/html/drush/sites
[preflight] Commandfile search paths: /var/www/html/vendor/drush/drush/src,/var/www/html/drush
[info] Starting bootstrap to none [0.68 sec, 2.93 MB]
[info] Drush bootstrap phase 0 [0.68 sec, 2.93 MB]
[info] Try to validate bootstrap phase 0 [0.68 sec, 2.93 MB]
[info] Executing: ssh -o PasswordAuthentication=no victor@www.law.uga.edu '/var/www/html/vendor/bin/drush core:status --fields=db-name --format=json --uri=http://www.law.uga.edu' [0.69 sec, 3.13 MB]
[info] Executing: /var/www/html/vendor/bin/drush core:status --fields=db-name --format=json --uri=default [1.9 sec, 3.13 MB]
[info] Executing: ssh -o PasswordAuthentication=no victor@www.law.uga.edu '/var/www/html/vendor/bin/drush core:status --fields=db-name --format=json --uri=http://www.law.uga.edu' [2.55 sec, 3.13 MB]
@GoodNovember
GoodNovember / ecs.js
Created October 2, 2023 20:02
an Entity Component System written in JavaScript
// ENTITIES
let counter = 0
let entities = new Set()
/**
* Creates a new entity and returns its id
* @returns {number} id of the new entity
*/
export function makeEntity(){
@GoodNovember
GoodNovember / bounding_box.rs
Last active April 7, 2023 03:54
A Rust Octree implementation that uses Bevy's math code.
use bevy::math::{ Vec3 };
#[derive(Debug, Clone, Copy, PartialEq)]
/// an axist aligned bounding box in 3d space
pub struct BoundingBox {
pub center: Vec3,
pub half_extents: Vec3,
}
impl BoundingBox {
@GoodNovember
GoodNovember / makeSignal.js
Created November 7, 2021 16:26
My take on the Signal event concept
export const makeSignal = () => {
const subscriptions = new Map()
const signal = {
get size () {
return subscriptions.size
},
subscribe (listenerFn) {
if (subscriptions.has(listenerFn) === false) {
if (typeof listenerFn === 'function') {
@GoodNovember
GoodNovember / machine.js
Created September 25, 2020 05:29
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@GoodNovember
GoodNovember / _faq.scss
Created July 27, 2020 18:24
University of Georgia School of Law's Covid FAQ code.
// these are my Development Clown Colors, please change them to match your school's brand guide.
$unpressedBackgroundColor: gray;
$unpressedHoverBackgroundColor: gold;
$unpressedTextColor: black;
$pressedBackgroundColor: red;
$pressedHoverBackgroundColor: blue;
$pressedTextColor: white;
@GoodNovember
GoodNovember / createMachine.js
Created March 4, 2020 23:29
Custom Finite State Machine Stuff
// see: https://kentcdodds.com/blog/implementing-a-simple-state-machine-library-in-javascript
// mine is different, but that's where I got the original logic.
// is this an object?
const isObject = something => {
if(typeof something === 'object' && something){
return true
}else{
return false
@GoodNovember
GoodNovember / about.md
Created December 11, 2019 23:40
Single Page Apps with ZEIT Now, Parcel and React

This is a nice Single Page App stack example config.

ingredients

  • now // easy peasy deploys
  • react // pleasurable coding
  • parcel-bundler //easy packaging.
@GoodNovember
GoodNovember / Canvas.js
Created November 18, 2019 18:28
Generic Canvas2d React Element
import React, { useEffect, useRef } from 'react'
import { useRequestAnimationFrame } from '../hooks/useRequestAnimationFrame'
const getDPR = () => window.devicePixelRatio || 1.0
export const Canvas = ({
onRender,
contextType = '2d',
idealFPS = 60
}) => {