Skip to content

Instantly share code, notes, and snippets.

View knksmith57's full-sized avatar

Kyle Smith knksmith57

View GitHub Profile
@burkeholland
burkeholland / prd.md
Created April 10, 2025 19:50
TheUrlist PRD

Project Requirements Document: The Urlist Website

The following table outlines the detailed functional requirements of The Urlist website.

Requirement ID Description User Story Expected Behavior/Outcome
FR001 Creating a New URL List As a user, I want to be able to start a new, empty list so I can begin adding URLs. The system should provide a clear way for the user to initiate the creation of a new list, potentially presenting an empty list view or an "add new list" button.
FR002 A
@ruvnet
ruvnet / MLFlow.ipynb
Last active June 20, 2025 19:48
MLflow and DSPy Tutorial for Beginners
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Cikmo
Cikmo / README.md
Last active July 1, 2025 10:13
Connection handler that keeps Supabase Realtime channels alive. It automatically reconnects after errors, handles reauthentication, and more.

I had some issues getting a reliable connection up. Made this after a lot of experimentation and it now works well.

Includes how to keep the connection alive when the document is not visible, handles reconnecting on errors, and also fixes certain authentication issues when coming back to a document that has not been visible while the token expired.

To use it, you pass in a factory function for your RealtimeChannel. Do not call .subscribe() on the channel, the handler will do this for you. See example.

PS: If you're not using supabase-js you'll need to change stuff a bit. Instead of passing in SupabaseClient switch it to use RealtimeClient, and update the refreshSessionIfNeeded method to your authentication implementation.

If you see any problems or have suggestions for improvements, please leave a comment.

@GollyJer
GollyJer / app.config.ts
Last active December 9, 2024 14:15
app.config.ts
import { ConfigContext } from '@expo/config';
// eslint-disable-next-line no-console
// console.log('ENV', process.env);
// expands type in the vscode tooltip.
type ExpandTooltip<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
const EXPO_SDK = '51';
const BINARY_ITERATION_FOR_SDK = '1'; // start with 1. CAN NOT BE 0.
@LionelB5
LionelB5 / MockedLink.ts
Last active March 10, 2025 19:28
Apollo Client V3 link that supports mocking GraphQL subscriptions, mutations and queries. Particularly useful when testing components that rely on queries/mutations that execute concurrently to subscriptions that must be mocked.
@masonwolters
masonwolters / build-and-upload-simulator-binary.sh
Last active February 18, 2025 22:14
React native iOS with pre-built binaries
#
# This script is run in CI on master commits. It builds a debug binary
# for the iOS simulator and uploads it to the mobile-binaries repo.
#
# Then, when developer run `yarn ios` to develop locally, instead of
# having to build all of the native code, we just download the pre-built
# binary and install it on the simulator.
#
REPO_URL="{YOUR_GIT_URL}"
@JBGruber
JBGruber / docker-compose.yml
Last active March 10, 2025 01:26
My compose file to run ollama and ollama-webui
services:
# ollama and API
ollama:
image: ollama/ollama:latest
container_name: ollama
pull_policy: missing
tty: true
restart: unless-stopped
# Expose Ollama API outside the container stack (but only on the same computer;
@imankulov
imankulov / sqlalchemy_with_pydantic.py
Last active April 29, 2025 00:17
Using pydantic models as SQLAlchemy JSON fields (convert beween JSON and pydantic.BaseModel subclasses)
#!/usr/bin/env ipython -i
import datetime
import json
from typing import Optional
import sqlalchemy as sa
from sqlalchemy.orm import declarative_base, sessionmaker
from sqlalchemy.dialects.postgresql import JSONB
from pydantic import BaseModel, Field, parse_obj_as
@bmeck
bmeck / wip.mjs
Created June 24, 2021 14:00
in-progress in-thread heapsnapshot reflective API
import * as ns from './index.js';
import {promisify} from 'util';
import {createReadStream, createWriteStream} from 'fs';
import {Session} from 'inspector';
import {PassThrough} from 'stream';
import {createHash} from 'crypto';
const session = new Session();
const stream = new PassThrough();
@danopia
danopia / Dockerfile
Last active May 7, 2025 05:17
ERCOT Frozen Grid 2021 - Metrics Reporters
FROM hayd/alpine-deno:1.10.1
WORKDIR /src/app
ADD deps.ts ./
RUN ["deno", "cache", "deps.ts"]
ADD *.ts ./
RUN ["deno", "cache", "mod.ts"]
ENTRYPOINT ["deno", "run", "--unstable", "--allow-net", "--allow-hrtime", "--allow-env", "--cached-only", "--no-check", "mod.ts"]