Skip to content

Instantly share code, notes, and snippets.

View breadchris's full-sized avatar

Chris breadchris

View GitHub Profile
@breadchris
breadchris / main.go
Last active April 15, 2024 04:09
Postgres (OLTP) vs. Clickhouse (OLAP)
package main
import (
"database/sql"
"log"
"os"
"strconv"
"time"
_ "github.com/ClickHouse/clickhouse-go/v2"
@breadchris
breadchris / metaprompt.py
Created March 24, 2024 04:49
anthropic metaprompt
# @title Metaprompt Text
metaprompt = '''Today you will be writing instructions to an eager, helpful, but inexperienced and unworldly AI assistant who needs careful instruction and examples to understand how best to behave. I will explain a task to you. You will write instructions that will direct the assistant on how best to accomplish the task consistently, accurately, and correctly. Here are some examples of tasks and instructions.
<Task Instruction Example>
<Task>
Act as a polite customer success agent for Acme Dynamics. Use FAQ to answer questions.
</Task>
<Inputs>
{$FAQ}
{$QUESTION}
@breadchris
breadchris / hacker_playlist.md
Last active March 10, 2024 05:29
A collection of hackers and the music they listen to.

MCPS HSF - 8th annual high school cyber security competition. Want to help out?

Here are some bios of people who are hacking the planet. They used to be high schoolers, too, and understand how much work it is to get to where you want to be. Check out the dope stuff they listen to and are doing:

breadchris - ur so hacked If you want to know my origin story, you can read about it here. I like to hack things. Come watch my cracked stream. I am working on building an open-source app to let you build your own blog and customize it. You can build how your site looks with AI!
@breadchris
breadchris / Main.elm
Created January 26, 2024 03:22
TODO App Elm
module Main exposing (..)
import Browser
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
type alias Todo =
{ id : Int
, text : String
Every year I like to have a motto that I think about from time to time throughout the year. I find mottos more transformative than resolutions as mottos tend to influence subtly but in a profound way.
Anyways, my motto for this year is:
write every day.
Over this past year I started writing more blog posts and taking more notes and it feels incredibly rewarding. I like seeing the thoughts I have in my head in a medium where I can share with people for them to glance at or read deeply. I no longer feel the need to corner people into listening to my monologues.
Writing is incredibly liberating for my mind where ideas fly in and out constantly. I used to feel such anxiety trying to determine a purpose for writing and not wanting to publish something that isn't going to be, what I thought to be, quality writing. I was too focused on writing a post that could go viral on HackerNews that I was missing out on practice of channeling my thoughts into words.
What I have found is that having a bunch of thoughts laying a
@breadchris
breadchris / matrix.html
Created October 6, 2023 01:25
Matrix for your OBS stream
<html>
<style>
* {margin: 0; padding: 0}
canvas {display: block;}
</style>
<canvas id="canvas" width="150" height="150">The current time</canvas>
<script>
// Initialising the canvas
var canvas = document.querySelector('canvas'),
ctx = canvas.getContext('2d');
@breadchris
breadchris / split.go
Created September 15, 2023 21:15
Go Split WAV File
package main
import (
"fmt"
"github.com/go-audio/wav"
"github.com/lunabrain-ai/lunabrain/pkg/store/bucket"
"github.com/pkg/errors"
"math"
"os"
"path"
@breadchris
breadchris / hybrid.py
Last active August 22, 2023 20:50
BM25 and FAISS hybrid search example
import numpy as np
from rank_bm25 import BM25Okapi
from sentence_transformers import SentenceTransformer
import faiss
class HybridSearch:
def __init__(self, documents):
self.documents = documents
# BM25 initialization
@breadchris
breadchris / soundbite.md
Created June 16, 2023 18:59
Why soundbite should exist
  • TL;DR soundbite is a podcasting platform, supercharged by advancements in content discovery, to connect with your friends and your community before international influencers.
  • Authenticity is a commodity in modern day communication. When we wake up, we look at our phone, during breakfast, we look at our phone, at work when we are bored, we look at our phone, going to the bathroom? phone. Watching TV? phone. Avoiding going to bed? phone. It is the first and last thing we look at every day.
  • What do we spend our day doing on the phone? Catching up with some celebrity, social media influencer, some random hair salon that cuts hair with fire. "The algorithm" is really good at what it does, and what it is doing is keeping you on the platform by any means necessesary. If you spend a second longer than usual fixated on a some guy lifting a lot of weight your digital content butler is going to start serving you videos of weightlifters. The faster the algorithm can glean information about your engagement with the
@breadchris
breadchris / parse.go
Created May 26, 2023 17:54
Protobuf Protoflow Workflow
package grpc
import (
"fmt"
"github.com/jhump/protoreflect/desc"
"google.golang.org/protobuf/types/descriptorpb"
"strings"
"testing"
)