Skip to content

Instantly share code, notes, and snippets.

View EncodeTheCode's full-sized avatar
🤗
Coding useful tools for workflow.

EncodeTheCode

🤗
Coding useful tools for workflow.
View GitHub Profile
import numpy as np
# =========================
# Base Entity System
# =========================
class Entity:
"""Base class for any object in the 3D world."""
def __init__(self, position):
self.position = np.array(position, dtype=float)
import numpy as np
from typing import Callable, Optional
# -------------------------
# Utility functions
# -------------------------
def aabb_overlap(min_a: np.ndarray, max_a: np.ndarray, min_b: np.ndarray, max_b: np.ndarray) -> bool:
"""Fast AABB overlap test: True if boxes overlap on X,Y,Z."""
# vectorized: overlap if max_a >= min_b and max_b >= min_a on all axes
"""
collision_entities.py
Requirements:
pip install numpy
Optional (for visual debug): pip install PyOpenGL PyOpenGL_accelerate
"""
import numpy as np
from typing import Callable, Optional, List, Tuple
import requests
import dns.resolver
import whois
import tldextract
from tqdm import tqdm
from urllib.parse import urljoin, urlparse
# ----------------------------
# HTTP Redirect Resolver
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Array → Table</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style>
body{font-family:system-ui,Arial;background:#f4f6f8;padding:18px}
.card{background:#fff;border-radius:8px;padding:10px;margin:12px 0;box-shadow:0 6px 18px rgba(0,0,0,.05)}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Simple HTML5 Table From Array</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style>
body{
font-family: Arial, Helvetica, sans-serif;
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Array-of-Arrays → Table (no keys)</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style>
body{font-family:system-ui,Arial;background:#f4f6f8;padding:18px;color:#111}
.card{background:#fff;border-radius:8px;padding:10px;margin:12px 0;box-shadow:0 6px 18px rgba(10,20,40,.04)}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Array-of-Arrays → Table (no keys)</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style>
body{font-family:system-ui,Arial;background:#f4f6f8;padding:18px;color:#111}
.card{background:#fff;border-radius:8px;padding:10px;margin:12px 0;box-shadow:0 6px 18px rgba(10,20,40,.04)}
// ===============================
// RAW XBOX CONTROLLER (Hardware)
// ===============================
class XboxController {
constructor(index = 0, deadzone = 0.15) {
this.index = index;
this.deadzone = deadzone;
// ---- RAW BUTTON STATES ----
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Deterministic Name Combiner — Real-name Pool</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style>
:root{--accent:#ff7a18;--bg:#0f1724;--muted:#9aa6b2;--glass:rgba(255,255,255,0.03);font-family:Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial}
*{box-sizing:border-box}