Skip to content

Instantly share code, notes, and snippets.

@fre-sch
fre-sch / points-lines-on-circle.js
Created January 2, 2023 08:55
Given a number of colors, calculate points on a circle centered on a canvas, draw lines between all points and then draw points over the lines using the colors.
const canvas = document.querySelector("#thecanvas")
const context = canvas.getContext("2d")
const midpoint = {x: canvas.width / 2, y: canvas.height / 2}
const colors = ["red", "green", "blue", "cyan", "magenta", "orange"]
const padding = 20
const radius = (Math.min(canvas.width, canvas.height) - padding) / 2
const d = Math.PI * 2 / colors.length
const points = colors.map((color, index) => {
const x = Math.cos(d * index) * radius
const y = Math.sin(d * index) * radius
@fre-sch
fre-sch / new_ship_part_guide.md
Last active April 10, 2024 14:25
Starfield guide for creating new ship parts.

Adding New ship part to Starfield using xEdit

Tools

To edit ESM files you need compatible xEdit build. That means version 1.4.4r or later (October 2023). Do NOT use versions 1.4.4c or older.

After downloading extract the ZIP file, then rename the EXE file "xEdit64.exe" to "SF1xEdit64.exe". 64-bit version is recommended, and to work on Starfield files executable needs to start with "SF1".

Double click the "SF1xEdit64.exe" then let it work on first run to index the data, this will take 10 minutes or little bit more. It will let you know in the bottom status bar when it's done. Following starts will take 10-40 seconds.

@fre-sch
fre-sch / App.svelte
Last active May 15, 2024 05:51
Svelte 4 single visible menus/popover/tooltip
<script>
import Popover from "./popover.svelte"
</script>
<div>
<p>
Some text here and show a <Popover label="popover(1)">First popover</Popover> and some more text.
</p>
<p>
Another <Popover label="popover(2)">second popover</Popover> and some more text.