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 June 29, 2024 14:21
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 May 1, 2024 10:55
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 <michele@locati.it>
// 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 {