Skip to content

Instantly share code, notes, and snippets.

View EricEisaman's full-sized avatar

SirFizX EricEisaman

View GitHub Profile
@EricEisaman
EricEisaman / index.html
Created December 5, 2013 19:05
Processing.js
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>$title</title>
$styles
</head>
<body>
<h1>$title</h1>
@EricEisaman
EricEisaman / SimpleHTTPServerWithUpload.py
Created January 16, 2017 16:40 — forked from touilleMan/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@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.
"""
{
"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 / 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
@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 / 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
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 / 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");