Skip to content

Instantly share code, notes, and snippets.

@jasonjmcghee
jasonjmcghee / cached_chroma.py
Last active April 5, 2024 10:24
Cached embeddings in Chroma made easy.
from abc import ABC
from typing import List, Optional, Any
import chromadb
from langchain.docstore.document import Document
from langchain.embeddings.base import Embeddings
from langchain.vectorstores import Chroma
class CachedChroma(Chroma, ABC):
@noah
noah / networkconfig.txt
Created October 4, 2015 22:43
network config files for raspberry pi USB-N53
pi@host ~ $ cat /etc/network/interfaces
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet static
wpa-ssid myessid
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
address 192.168.1.xxx
@noah
noah / ga
Created March 13, 2012 14:50
#!/bin/zsh
# simplify gnupod_addsong.pl syntax
#
# point it at a directory to add all .mp3 and .flac recursively
# - encodes flac to V0 (-x mp3 -e 0 flag)
if [ $# -eq 0 ]; then
echo "$0 <dir>"
exit -1
@hSATAC
hSATAC / 256color.pl
Created July 20, 2011 14:48
256color.pl
#!/usr/bin/perl
# Author: Todd Larason <jtl@molehill.org>
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $
# use the resources for colors 0-15 - usually more-or-less a
# reproduction of the standard ANSI colors, but possibly more
# pleasing shades
# colors 16-231 are a 6x6x6 color cube
for ($red = 0; $red < 6; $red++) {
@query
query / rtorrent_xmlrpc.py
Created April 2, 2011 17:25
Python module for interacting with rtorrent's XML-RPC interface directly over SCGI.
#!/usr/bin/python
# rtorrent_xmlrpc
# (c) 2011 Roger Que <alerante@bellsouth.net>
#
# Python module for interacting with rtorrent's XML-RPC interface
# directly over SCGI, instead of through an HTTP server intermediary.
# Inspired by Glenn Washburn's xmlrpc2scgi.py [1], but subclasses the
# built-in xmlrpclib classes so that it is compatible with features
# such as MultiCall objects.