Skip to content

Instantly share code, notes, and snippets.

@Nishkalkashyap
Nishkalkashyap / gemini.object-converter.ts
Last active October 23, 2025 20:33
Zod Schema Converter for Google Generative AI Compatibility
/**
* Gemini generated object to original schema compatible object converter
*
* Utility to convert Gemini generated objects back to their original schema format.
* Pairs with gemini.schema-converter.ts
*/
import { z } from "zod";
function findDiscriminatorKey(schema: z.ZodTypeAny): string | null {
if (schema instanceof z.ZodUnion) {
anonymous
anonymous / playground.rs
Created August 26, 2016 16:00
Shared via Rust Playground
use std::cell::RefCell;
use std::rc::Rc;
// A graph can be represented in several ways. For the sake of illustrating how
// interior mutability works in practice, let's go with the simplest
// representation: a list of nodes.
// Each node has an inner value and a list of adjacent nodes it is connected to
// (through a directed edge).
// That list of adjacent nodes cannot be the exclusive owner of those nodes, or
// else each node would have at most one edge to another node and the graph
@kachayev
kachayev / concurrency-in-go.md
Last active September 23, 2025 16:12
Channels Are Not Enough or Why Pipelining Is Not That Easy
@staltz
staltz / introrx.md
Last active December 1, 2025 11:31
The introduction to Reactive Programming you've been missing
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active November 16, 2025 11:36
A badass list of frontend development resources I collected over time.
@forhappy
forhappy / kmeans.py
Created September 21, 2011 06:27
python implemtion k-means algorithm
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import cmath
import os.path
class KMeans:
'''
@descriptions: K-means Algorithm implementation.