Skip to content

Instantly share code, notes, and snippets.

View sleepy-monax's full-sized avatar
☀️
Building delightful software and tools

Sleepy Monax sleepy-monax

☀️
Building delightful software and tools
View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active June 29, 2024 20:23
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@bradmartin333
bradmartin333 / raylib_keystone.py
Last active May 12, 2023 18:39
Keystone correction using y = mx + b
from pyray import *
import csv
# Constants
start_wid = 800
start_hgt = 600
debug = True
def lerp(v1: Vector2, v2: Vector2, ratio: float):
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active May 28, 2024 15:33
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

@61131
61131 / macros.h
Last active November 19, 2022 16:20
C pre-processor macro abuse to prepend number of arguments to variadic functions
#ifndef _MACROS_H
#define _MACROS_H
#include <stdint.h>
#include <stdarg.h>
/*
The following macros are used to prepend the number of arguments for
variadic functions.
*/
@oofdere
oofdere / interjection.txt
Created May 10, 2019 05:31
Windows Core OS.iso
I'd just like to interject for a moment. What you're referring to as Windows,
is in fact, GNU/NT, or as I've recently taken to calling it, GNU plus NT.
Windows NT is not an operating system unto itself, but rather a proprietery component
of a fully functioning GNU system made useful by the GNU corelibs, shell
utilities and vital system components comprising a full OS as defined by POSIX.
Many computer users run a modified version of the GNU system every day,
without realizing it. Through a peculiar turn of events, the version of GNU
which is widely used today is often called "Windows NT", and many of its users are
not aware that it is basically the GNU system, developed by the GNU Project.

Making a PDF + Bootable ISO Hybrid Polyglot

If you've not seen my résumé, that is what this post is about, and you should probably look at it first to get an idea of what's happening.

A Tale of Two Files

PDF and ISO9660 are two very different file formats. PDF is actually a surprisingly human-readable (but, sadly, not very human-writable) plain-text format, technically descended from PostScript. PDF is not very forgiving on changes, as it stores tables of offsets to various elements, so it is very difficult to insert or remove content manually without going through a robust PDF manipulation library.

ISO9660 is a disk filesystem, meant to be written once and read many times on many different kinds of hardware. As it is sector-based, it expects data structures to be at particular absolute offsets.

@hahastudio
hahastudio / mandelbrot.py
Created November 19, 2012 10:29
A Mandelbrot-Shaped Python Script that generate a Mandelbrot Fractal
_ = (
255,
lambda
V ,B,c
:c and Y(V*V+B,B, c
-1)if(abs(V)<6)else
( 2+c-4*abs(V)**-0.4)/i
) ;v, x=1500,1000;C=range(v*x
);import struct;P=struct.pack;M,\
j ='<QIIHHHH',open('M.bmp','wb').write
@masak
masak / explanation.md
Last active June 18, 2024 08:24
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.