Skip to content

Instantly share code, notes, and snippets.

View anotherjesse's full-sized avatar

Jesse Andrews anotherjesse

View GitHub Profile
@anotherjesse
anotherjesse / list-gems.ts
Created September 15, 2024 17:48
broken inspect link? gem isn't a cell?
import { recipe, lift, UI, NAME, ID, handler } from "@commontools/common-builder";
import { dataGems, Gem, launch } from "../data.js";
import { html } from "@commontools/common-html";
import { CellImpl } from "@commontools/common-runner";
const dump = lift(({ object }) => JSON.stringify(object, null, 2));
export const jsonView = recipe<{ object: any; name: string }>(
"json debug",
@anotherjesse
anotherjesse / list-gems.ts
Created September 15, 2024 13:33
list gems recipe
import { recipe, lift, UI, NAME, ID, handler } from "@commontools/common-builder";
import { dataGems } from "../data.js";
import { html } from "@commontools/common-html";
const getGems = lift(({ count }) => dataGems.get());
const inc = handler<{}, { count: number }>((_, state) => {
state.count += 1;
});
<script lang="ts">
import { perlinNoise2dFactory } from "squeaker";
let svgCanvas: SVGElement;
let numberOfColors = 1;
const colorOptions = [3, 4, 5];
const palletes: Record<string, string[]> = {
reds: ["#ff0000", "#ff4040", "#ff8080", "#ffc0c0", "#ffe0e0"],
greens: ["#00ff00", "#40ff40", "#80ff80", "#c0ffc0", "#e0ffe0"],
blues: ["#0000ff", "#4040ff", "#8080ff", "#c0c0ff", "#e0e0ff"],
<script lang="ts">
let svgCanvas: SVGElement;
let numberOfColors = 3;
const colorOptions = [3, 4, 5];
const palletes: Record<string, string[]> = {
"reds": ["#ff0000", "#ff4040", "#ff8080", "#ffc0c0", "#ffe0e0"],
"greens": ["#00ff00", "#40ff40", "#80ff80", "#c0ffc0", "#e0ffe0"],
"blues": ["#0000ff", "#4040ff", "#8080ff", "#c0c0ff", "#e0e0ff"],
"yellows": ["#ffff00", "#ffff40", "#ffff80", "#ffffc0", "#ffffe0"],
"purples": ["#ff00ff", "#ff40ff", "#ff80ff", "#ffc0ff", "#ffe0ff"],
@anotherjesse
anotherjesse / pca.json
Created July 3, 2024 06:36
umap_pca_of_clip_sae
This file has been truncated, but you can view the full file.
{
"2": [
0.01681773543658595,
-0.004168102482493682
],
"3": [
0.017646509435702475,
-0.00592362233619472
],
"4": [
package main
import (
"fmt"
"math/rand"
"os"
"os/signal"
)
const (
@anotherjesse
anotherjesse / book-titles.txt
Created January 27, 2024 16:09
moondream-random.txt
seed: 0 output: The Complete Book of Modern Paisley (Paisley Collection)
seed: 1 output: The Complete Idiot's Guide to Doing Nothing
seed: 2 output: The Complete Guide to Cat Care
seed: 3 output: The Complete Idiot's Guide to Sewing, Stitching, Needlepoint, and More
seed: 4 output: The Complete Idiot's Guide to Tennis: Everything You Need to Know About Tennis, One Game at a Time
seed: 5 output: The Complete Guide to Building a Website (The Complete Guides)
seed: 6 output: The Complete Idiot's Guide to Baking
seed: 7 output: The Complete Guide to Bicycle Repair
seed: 8 output: The Complete Idiot's Guide to Gardening
seed: 9 output: Big Bird Singing Classic
def generate(prompt, filename):
# Simulate the generation process (you can replace this with your actual function)
print(f"Generating '{prompt}' and saving as '{filename}'")
# Options for each category
expressions = ["happy", "sad", "crying", "angry", "open mouth"]
genders = ["male", "female", "non-binary"]
ages = ["kid", "teen", "young adult", "adult", "old"]
ethnicities = ["Caucasian", "Hispanic", "Black", "Middle-Eastern", "South Asian", "East Asian"]
styles = ["realistic", "cartoon", "comics"]
@anotherjesse
anotherjesse / README.md
Created April 2, 2023 02:38
langchain + vectorstore of liked tweets

A first pass at creating a @langchain vectorstore for each tweet I have "liked"

I already store them as a json blob on https://lets.m4ke.org/tweets

This ingests them documents - each looking like @twitter_user_name says tweet_text_here

Samples:

>>> qa.run("what is @jakedahn tweeting about")

' @jakedahn is tweeting about art and creativity.'

@anotherjesse
anotherjesse / polling-vs-webhooks.md
Created March 14, 2023 22:04
polling vs webhooks - replicate-python

polling

model = replicate.models.get("replicate/hello-world")
version = model.versions.get("5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa")
inputs = {
  "text": "world",
}
output = version.predict(**inputs)

webhook