Skip to content

Instantly share code, notes, and snippets.

@FadedWeiss
FadedWeiss / Web Component for Copyright Years.md
Created March 29, 2024 05:32
Web Component for Copyright Years
@FadedWeiss
FadedWeiss / markov.py
Created January 10, 2024 01:16 — forked from benhoyt/markov.py
Generate text from an input using a simple Markov chain generator
import collections, random, sys, textwrap
# Build possibles table indexed by pair of prefix words (w1, w2)
w1 = w2 = ''
possibles = collections.defaultdict(list)
for line in sys.stdin:
for word in line.split():
possibles[w1, w2].append(word)
w1, w2 = w2, word
@FadedWeiss
FadedWeiss / index.html
Created December 19, 2023 15:10
Terrain coloring without a shader
<script async src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js" crossorigin="anonymous"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/"
}
}
</script>
@FadedWeiss
FadedWeiss / README.md
Created September 13, 2023 02:18 — forked from kfox/README.md
TCP echo server for Node.js

TCP echo server for Node.js

Usage

  1. Make sure you have a modern-ish version of Node.js installed.
  2. Type npx https://gist.github.com/kfox/1280c2f0ee8324067dba15300e0f2fd3
  3. Connect to it from a client, e.g. netcat or similar: nc localhost 9000
/*
* This is an experimental view library that would compete with react, svelte, qwik.js, vue.js etc.
*
* Implementation reference: https://git.sr.ht/~erock/alpfx
*
* Features:
* - Instead of `view = func(state)` we have `view = func(event)`
* - This paradigm shift will:
* - make prop mgmt (e.g. when to update component) more manual
* - animations easier (events or transitions are sent to the component that the end-user
@FadedWeiss
FadedWeiss / animal-crossing-new-horizons-camera-tilt-shift.markdown
Created July 17, 2023 06:06
Animal Crossing: New Horizons Camera & Tilt Shift
@FadedWeiss
FadedWeiss / how-to-render-an-object-crossing-another-object-v2.markdown
Created June 29, 2023 06:29
How to render an object crossing another object v2