Skip to content

Instantly share code, notes, and snippets.

View CryogenicPlanet's full-sized avatar
⚒️
Building something new

Rahul Tarak CryogenicPlanet

⚒️
Building something new
View GitHub Profile
@patheticGeek
patheticGeek / bookmarks.md
Last active November 4, 2023 15:23
Some useful things i have in my bookmarks
@rbuckton
rbuckton / ts-proposal-range-types.md
Last active June 20, 2024 05:26
Proposal: Range Types for TypeScript

Range Types (T[X:Y]) for TypeScript

A Range Type is a type that produces a new tuple or array type that derives from T by dropping the excess ordered elements of T outside of the range starting at offset X (inclusive) through offset Y (exclusive).

A Range Type is denoted using a : operator in what would otherwise be an Indexed Access Type:

type T = [1, 2, 3][0:2];
package main
import (
"bytes"
"context"
"fmt"
"log"
"net"
"net/http"
"os"