Skip to content

Instantly share code, notes, and snippets.

@klavinski
klavinski / dependentTypes.ts
Created July 9, 2025 18:55
Dependent types in TypeScript
interface Parser {
args: [ `${number}` ]
return: this[ "args" ] extends [ `${infer N extends number}` ] ? N : never
}
type DF<I extends { args: unknown[], return: unknown }> = ( <T extends I[ "args" ]>( ...args: T ) => ( I & { args: T } )[ "return" ] ) & { __type?: I }
type Apply<F extends ( ( ...args: any ) => any ), X extends Parameters<F>> = F extends { __type?: infer T extends { return: unknown } } ? ( T & { args: X } )[ "return" ] : ReturnType<F>
const parse: DF<Parser> = ( <T extends `${number}`>( str: T ) => parseFloat( str ) as T extends `${infer N extends number}` ? N : never as any )
@hprez21
hprez21 / Program.cs
Created July 9, 2025 18:53
Creating the SK project, environment variables and Kernels
using Microsoft.SemanticKernel;
var openAIKey = Environment.GetEnvironmentVariable("SKCourseOpenAIKey");
var azureRegion = Environment.GetEnvironmentVariable("SKCourseAzureRegion");
var azureKey = Environment.GetEnvironmentVariable("SKCourseAzureKey");
Kernel openAIKernel = Kernel.CreateBuilder()
.AddOpenAIChatCompletion("gpt-4o-mini-2024-07-18", $"{openAIKey}")
.Build();
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aqscithe
aqscithe / AeonixNavigation.txt
Last active July 9, 2025 19:40
AeonixNavigation
Directory structure:
└── midgen-aeonixnavigation/
├── README.md
└── Source/
├── AeonixEditor/
│ ├── AeonixEditor.build.cs
│ ├── AeonixEditor.h
│ └── Private/
│ ├── AenoixEditorDebugSubsystem.cpp
│ ├── AenoixEditorDebugSubsystem.h
@Akshay-Eypz
Akshay-Eypz / menn.js
Created July 9, 2025 18:52
izumi mention
const { izumi } = require('../lib');
const axios = require("axios");
const sharp = require("sharp");
const config = require('../config');
const renderLargerThumbnail = false;
const mediaList = [
{
audioUrl: "https://files.catbox.moe/nbzrcw.mp4",
@lancew
lancew / cja_plan.ics
Last active July 9, 2025 19:07
cja_plan.ics
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Your Organization//NONSGML v1.0//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
UID:20250725T000000Z-UlaanbaatarGrandSlam@example.com
DTSTAMP:20250709T190659Z
DTSTART;VALUE=DATE:20250725
DTEND;VALUE=DATE:20250728
SUMMARY:Ulaanbaatar Grand Slam
@mike-moreau
mike-moreau / config
Created July 9, 2025 18:51
mac ssh config file examples
# ~/.shh/config
# Defaults for all hosts
Host *
UseKeychain yes
AddKeysToAgent yes
Host github.com
IdentityFile ~/.ssh/id_github
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created July 9, 2025 18:51
Rimworld output log published using HugsLib
Log uploaded on Wednesday, July 9, 2025, 9:51:13 PM
Loaded mods:
Harmony(brrainz.harmony)[mv:2.3.4.0]: 0Harmony(2.3.3), HarmonyMod(2.3.1)
Core(Ludeon.RimWorld): (no assemblies)
Royalty(Ludeon.RimWorld.Royalty): (no assemblies)
Ideology(Ludeon.RimWorld.Ideology): (no assemblies)
Biotech(Ludeon.RimWorld.Biotech): (no assemblies)
Anomaly(Ludeon.RimWorld.Anomaly): (no assemblies)
[ATW] House Decor(mgatwood.housedecor): (no assemblies)
[CP] Detailed Body Textures II(CP.Detailed.Body.Textures.II): (no assemblies)
@adityawasudeo
adityawasudeo / Dockerfile
Created July 9, 2025 18:50
Running Vite + TS React in a dev container
FROM node:20-alpine AS init
RUN mkdir /app
WORKDIR /app
COPY package.json ./
COPY . .
FROM node:20-alpine AS dev
RUN mkdir /app
WORKDIR /app
COPY package.json ./
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
from scipy.special import jv
import cv2
from scipy.ndimage import rotate
NUM_FRAMES = 360
X_MAX = 10