Skip to content

Instantly share code, notes, and snippets.

View jbundziow's full-sized avatar
👋

Jakub Bundziów jbundziow

👋
  • stickysoft
  • Nowa Sól, lubuskie, Poland
View GitHub Profile
@maciejpedzich
maciejpedzich / TableOfContents.astro
Last active December 10, 2024 14:49
Astro Table Of Contents Component + Sample Usage
---
import type { MarkdownHeading } from 'astro';
type Props = {
headings: MarkdownHeading[];
};
type HeadingWithSubheadings = MarkdownHeading & {
subheadings: MarkdownHeading[];
};
@mlocati
mlocati / color-scale.js
Last active January 15, 2025 16:07
Javascript color scale from 0% to 100%, rendering it from red to yellow to green
// License: MIT - https://opensource.org/licenses/MIT
// Author: Michele Locati <[email protected]>
// Source: https://gist.github.com/mlocati/7210513
function perc2color(perc) {
var r, g, b = 0;
if(perc < 50) {
r = 255;
g = Math.round(5.1 * perc);
}
else {