Skip to content

Instantly share code, notes, and snippets.

@OrionReed
OrionReed / dom3d.js
Last active May 17, 2024 08:27
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; // ¯\\_(ツ)_/¯
@madskjeldgaard
madskjeldgaard / KloudGen.scd
Last active December 30, 2022 02:39
Sketch for a supercollider based cloud generator

/*

Sketch for a cloud generator

By Mads Kjeldgaard, 2020

*/ ( ~numChannels = 2; s.options.numOutputBusChannels_(~numChannels);

@raysan5
raysan5 / custom_game_engines_small_study.md
Last active May 17, 2024 05:02
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

@mikeananev
mikeananev / coder.clj
Last active April 8, 2024 19:38
Adaptive LZW compression on Clojure
(ns coder ;; org.rssys.lzw
(:require [clojure.java.io :as io])
(:import (java.io InputStream OutputStream)
(com.github.jinahya.bit.io StreamByteInput StreamByteOutput DefaultBitOutput DefaultBitInput)))
(def MAX-BITS-LENGTH 18)
(def EOF 256)
(defn lzw-encode-stream
[^InputStream in-stream ^OutputStream out-stream]
[nix-shell:~/src/kakoune]$ find $XDG_RUNTIME_DIR/kak/foo
/run/user/1000/kak/foo
/run/user/1000/kak/foo/buffers
/run/user/1000/kak/foo/buffers/0x17d8610
/run/user/1000/kak/foo/buffers/0x17d8610/bufname
/run/user/1000/kak/foo/buffers/0x17d8610/buffile
/run/user/1000/kak/foo/buffers/0x17d8610/buf_line_count
/run/user/1000/kak/foo/buffers/0x17d8610/timestamp
/run/user/1000/kak/foo/buffers/0x17d8610/history_id
/run/user/1000/kak/foo/buffers/0x17d8610/modified

A Redux Story

Developer: "Doo Doo Doo... Working on the new Redux rewrite. Gotta write some fetch actions..."

FETCH_USERS -> function fetchUsersAction() {...}
FETCH_PAGES -> function fetchPagesAction() {...}
FETCH_FRIENDS -> function fetchFriendsAction() {...}
FETCH_GROUPS -> function fetchGroupsAction() {...}
FETCH_EVENTS -> function fetchEventsAction() {...}
@terabyte
terabyte / amazon.md
Created December 6, 2017 02:27
Amazon's Build System

Prologue

I wrote this answer on stackexchange, here: https://stackoverflow.com/posts/12597919/

It was wrongly deleted for containing "proprietary information" years later. I think that's bullshit so I am posting it here. Come at me.

The Question

Amazon is a SOA system with 100s of services (or so says Amazon Chief Technology Officer Werner Vogels). How do they handle build and release?

How Clojure's documentation can leapfrog other languages

Summary

I made a documentation generator that cashes in on Clojure's dynamism. See the play-cljs docs (a ClojureScript game library) for an example of its output.

The Problem

Like many of you, I've often wondered what my final regret will be on my deathbed. My best guess came to me in a dream recently. I was walking across the charred earth of an apocalyptic future world, maneuvering around the remains of the less fortunate. I was startled to find a young girl, barely holding onto her life. She murmured something to me. I asked her to repeat it, and she said more loudly: "I...wish your Clojure projects didn't have such crappy documentation."

The project can be built using Lumo

npm install -g lumo-cljs
lumo build.cljs