Skip to content

Instantly share code, notes, and snippets.

@ic
ic / vsp-chroma.py
Created December 12, 2023 07:06
Conceptual example around a vector store, here Chroma
from pprint import pprint as pp
import chromadb
client = chromadb.Client()
collection = client.create_collection("all-my-documents")
# "document" is Chroma terminology. In VectorDB and others it is "chunk"
# And when querying with Chroma, response "units" are "documents". So better
# chop them finely to get good granularity, or not at all to get whole docs.
@ic
ic / disable.sh
Last active May 5, 2020 01:28
Disable bunch of #$!@ in Catalina
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# If the disk is encrypted, you need to mount it with:
#

Keybase proof

I hereby claim:

  • I am ic on github.
  • I am ic (https://keybase.io/ic) on keybase.
  • I have a public key ASCYkNjs13jWiZmfSKvdZQ9-gW0uXSLcfTgdaCrCjYvSSAo

To claim this, I am signing this object:

@ic
ic / mg-811_auto-ctrl.ino
Last active July 12, 2017 04:23
MG-811 Calibration for the auto-ctrl board on Arduino (UNO)
/*
* About the calibration model:
* This calibration is very simple, and so lacks accuracy for serious use. See this script as a getting-started solution.
* The calibration relies on 2 points, at 400ppm and 1000ppm. The 400ppm is the assumed CO2 concentration in "fresh air".
* You see that this number is really inaccurate (references ranges from 350 to 390ppm). The 1000ppm comes from TODO.
* 150s -> ~40000ppm
* 0s -> ~400ppm, approximate linear growth based on Vernier's
* slope = 264 ppm/s; V0 = 400
* Avg human 1 breath every 3-5s
* => 1 breath ~ +792 to +1320ppm => avg. 1056ppm, let's say 1000ppm
@ic
ic / run_opensimroot_demo
Last active July 6, 2017 02:29
Setup and prepare for running the OpenSimRoot demo.
#!/usr/bin/env bash
#
# Setup and prepare for visualizing the OpenSimRoot demo.
#
# Stages:
# * Get OpenSimRoot and its dependencies,
# * Get the demo data,
# * Execute the data crunching,
# * Explain how to run the visualization.
### Keybase proof
I hereby claim:
* I am ic on github.
* I am ic (https://keybase.io/ic) on keybase.
* I have a public key whose fingerprint is C501 A1B8 1B7C 97FE C442 D4DC 953C 7658 D0B4 BCCA
To claim this, I am signing this object:
@ic
ic / html5.vim
Last active August 29, 2015 14:06 — forked from rcmachado/html5.vim
" Vim syntax file
" Language: HTML (version 5)
" Maintainer: Rodrigo Machado <rcmachado@gmail.com>
" URL: http://gist.github.com/256840
" Last Change: 2014 Sept 22
" License: Public domain
" (but let me know if you liked it :) )
"
" Note: This file just adds the new tags from HTML 5
" and don't replace default html.vim syntax file