Skip to content

Instantly share code, notes, and snippets.

View EricEisaman's full-sized avatar

SirFizX EricEisaman

View GitHub Profile
@EricEisaman
EricEisaman / hello_world.py
Created March 17, 2024 16:11 — forked from matthen/hello_world.py
Hello world in python, using genetic algorithm
"""Hello world, with a genetic algorithm.
https://twitter.com/matthen2/status/1769368467067621791
"""
import random
import time
from dataclasses import dataclass
from itertools import chain
from typing import Iterable, List
@EricEisaman
EricEisaman / Prologue.js
Last active August 12, 2023 15:41
Prologue Logging Utility
class Prologue {
constructor() {
this.originalConsole = {
log: console.log,
warn: console.warn,
error: console.error,
};
const urlParams = new URLSearchParams(window.location.search);
const logsParam = urlParams.get("logs");
@EricEisaman
EricEisaman / Prologue.ts
Last active August 12, 2023 16:13
Prologue Logging Utility Module
/**
* Prologue is a utility class that monkey patches the browser window's console.log,
* console.warn, and console.error functions by wrapping them. It allows for filtering
* console logs based on tags specified in the URL.
*
* @remarks
* This class is a utility for efficient debugging and logging in the browser environment.
*
* @example
* // Creating an instance of Prologue
worker1 = `self.onmessage = function(e) {
self.postMessage('msg from worker');
};`
const blob = new Blob([
worker1
], { type: "text/javascript" })
// Note: window.webkitURL.createObjectURL() in Chrome 10+.
const worker = new Worker(window.URL.createObjectURL(blob));
@EricEisaman
EricEisaman / avatars100Square.js
Created July 27, 2021 16:34
Spawn 100 avatars in square matrix
Array.prototype.randomItem = function () {
return this[Math.floor(Math.random() * this.length)];
};
const names = ["Aaran", "Aaren", "Aarez", "Aarman", "Aaron", "Aaron-James", "Aarron", "Aaryan", "Aaryn", "Aayan", "Aazaan", "Abaan", "Abbas", "Abdallah", "Abdalroof", "Abdihakim", "Abdirahman", "Abdisalam", "Abdul", "Abdul-Aziz", "Abdulbasir", "Abdulkadir", "Abdulkarem", "Abdulkhader", "Abdullah", "Abdul-Majeed", "Abdulmalik", "Abdul-Rehman", "Abdur", "Abdurraheem", "Abdur-Rahman", "Abdur-Rehmaan", "Abel", "Abhinav", "Abhisumant", "Abid", "Abir", "Abraham", "Abu", "Abubakar", "Ace", "Adain", "Adam", "Adam-James", "Addison", "Addisson", "Adegbola", "Adegbolahan", "Aden", "Adenn", "Adie", "Adil", "Aditya", "Adnan", "Adrian", "Adrien", "Aedan", "Aedin", "Aedyn", "Aeron", "Afonso", "Ahmad", "Ahmed", "Ahmed-Aziz", "Ahoua", "Ahtasham", "Aiadan", "Aidan", "Aiden", "Aiden-Jack", "Aiden-Vee", "Aidian", "Aidy", "Ailin", "Aiman", "Ainsley", "Ainslie", "Airen", "Airidas", "Airlie", "AJ", "Ajay", "A-Jay", "Ajayraj", "Ak
@EricEisaman
EricEisaman / machine.js
Last active July 6, 2021 02:19
Generated by XState Viz: https://xstate.js.org/viz
const raceMachine = Machine({
id: 'Racing Game',
initial: 'lobby',
states: {
lobby: {
on: {
TIMER: 'start'
}
},
start: {
@EricEisaman
EricEisaman / fast-rough-edge-shadow.glsl
Created March 19, 2020 20:03 — forked from mattdesl/fast-rough-edge-shadow.glsl
Fast Rough-Edge Shadows Pseudocode
// Your shadow map comparison, this is builtin to ThreeJS
float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
}
float getShadow () {
float texelSize = 1.0 / shadowMapPixelDimension;
float shadowStepSize = 0.5; // adjust to taste
{
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36",
"lighthouseVersion": "2.3.0",
"generatedTime": "2017-07-31T04:19:13.908Z",
"initialUrl": "https://piggahbro.ddns.net/gaming/forums/",
"url": "https://piggahbro.ddns.net/gaming/forums/",
"audits": {
"is-on-https": {
"score": true,
"displayValue": "",
@EricEisaman
EricEisaman / SimpleHTTPServerWithUpload.py
Created January 16, 2017 16:41 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""