Skip to content

Instantly share code, notes, and snippets.

type TabIndex = 0 | 1;
const tabsToRoutes: [TabIndex, string][] = [
[0, '/app'],
[1, '/app/profile'],
]
const tabToRoute = function(index: TabIndex): string {
return tabsToRoutes.find(entry => entry[0] == index)[1];
}
@podikoglou
podikoglou / metrics.go
Created July 11, 2024 20:01
I really like this piece of code but I realised it's useless
package engine
import (
"sync/atomic"
"time"
"github.com/emirpasic/gods/maps/hashmap"
)
const (
@podikoglou
podikoglou / reference.md
Last active March 11, 2025 12:10
LLM-generated Nanostores & Nanostores Persistent Reference

Nano Stores Reference Guide

Nano Stores is a state management library designed for small, fast, and easily tree-shakeable applications. It focuses on moving application logic into stores, making the codebase more modular and testable. It supports multiple frameworks (React, Preact, Vue, Svelte, Solid, Lit, Angular, and vanilla JS).

Nano Stores Persistent (for local storage synchronization): This library extends Nano Stores to manage state persistently in localStorage and synchronize changes across browser tabs.

Core Concepts:

  • Atoms: Basic store for primitive types (e.g., numbers, strings, arrays, objects).
  • Maps: Stores key-value pairs. Changes to keys are tracked and can be used to trigger updates. Handles updating (like setKey()) instead of complete replacement.
@podikoglou
podikoglou / cpp-gen
Created February 24, 2025 20:53
simple, no bs c++ project generator (claude 3.7 sonnet)
#!/bin/bash
set -e
# Function to display usage information
show_usage() {
echo "Usage: $0 <project_name>"
echo "Creates a minimal C++ project structure"
}
# Function to output colored text

My Notes on Lean4

Types

A few basic types are:

  • Bool
  • Nat
  • Float

Constants

You define constants with the following syntax: