Skip to content

Instantly share code, notes, and snippets.

View endel's full-sized avatar

Endel Dreyer endel

View GitHub Profile
@endel
endel / vibejam-2026.md
Last active May 8, 2026 13:33
Colyseus Games — Vibe Jam 2026
@endel
endel / colyseus-schema-encode-debug.ts
Last active December 18, 2025 18:35
Debugging "refId not found" errors in @colyseus/schema v3
import fs from "fs";
import { Schema, Reflection } from "@colyseus/schema";
// ...
class MyRoom extends Room {
// ...
onCreate() {
fs.writeFileSync("patch-debug.log", "");
@endel
endel / cpuinfo
Created November 28, 2025 20:07
Regular Compute: cat /proc/cpuinfo && lscpu
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel Core Processor (Haswell, no TSX, IBRS)
stepping : 1
microcode : 0x1
cpu MHz : 2394.454
cache size : 16384 KB
physical id : 0
@endel
endel / cpuinfo
Created November 28, 2025 19:41
High Performance: cat /proc/cpuinfo && lscpu
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 85
model name : Intel Xeon Processor (Cascadelake)
stepping : 6
microcode : 0x1
cpu MHz : 2893.194
cache size : 16384 KB
physical id : 0
@endel
endel / cpuinfo
Last active November 28, 2025 19:40
High Frequency: cat /proc/cpuinfo && lscpu
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 94
model name : Intel Core Processor (Skylake, IBRS)
stepping : 3
microcode : 0x1
cpu MHz : 3695.998
cache size : 16384 KB
physical id : 0
@endel
endel / getMoonPhase.js
Created March 25, 2015 16:04
Get Moon Phase by Date, written in JavaScript
/*
* modified from http://www.voidware.com/moon_phase.htm
*/
function getMoonPhase(year, month, day)
{
var c = e = jd = b = 0;
if (month < 3) {
year--;
@endel
endel / lua-ternary-operator.lua
Created September 24, 2020 21:16
LUA Ternary Operator
local x = (y > 10) and "condition is true" or "condition is false"
@endel
endel / conver.pe
Last active August 16, 2024 21:03
FontForge script to convert .ttf file to its webfont variations (.otf, .svg, .woff, .woff2)
#!/usr/local/bin/fontforge
Open($1)
Generate($1:r + ".otf")
Generate($1:r + ".svg")
Generate($1:r + ".woff")
Generate($1:r + ".woff2")
// This code was written by Tyler Akins and has been placed in the
// public domain. It would be nice if you left this header intact.
// Base64 code from Tyler Akins -- http://rumkin.com
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function encode64(input) {
var output = new StringMaker();
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
@endel
endel / aws-ec2-root-node-port-80.sh
Created December 4, 2019 18:58
Allow non-root node to use ports 80 (HTTP) and 443 (HTTPS) (AWS EC2)
# Allow non-root node to use ports 80 (HTTP) and 443 (HTTPS)
sudo setcap 'cap_net_bind_service=+ep' $(which node)