Skip to content

Instantly share code, notes, and snippets.

View blakejakopovic's full-sized avatar

Blake Jakopovic blakejakopovic

View GitHub Profile
@virattt
virattt / rag-reranking-gpt-colbert-mistral.ipynb
Last active April 3, 2024 04:23
rag-reranking-gpt-colbert-mistral.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.agents import AgentType
from langchain.llms import OpenAI
llm = OpenAI(temperature=0, model="gpt-3.5-turbo-instruct")
from metaphor_python import Metaphor
client = Metaphor("")

Ad-free Twitter

Inject this css snippet to remove all ads from your Twitter timeline.

div[data-testid="placementTracking"]:has(path[d="M19.498 3h-15c-1.381 0-2.5 1.12-2.5 2.5v13c0 1.38 1.119 2.5 2.5 2.5h15c1.381 0 2.5-1.12 2.5-2.5v-13c0-1.38-1.119-2.5-2.5-2.5zm-3.502 12h-2v-3.59l-5.293 5.3-1.414-1.42L12.581 10H8.996V8h7v7z"]) {
  display: none;
}
@kconner
kconner / macOS Internals.md
Last active April 15, 2024 10:14
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@blakejakopovic
blakejakopovic / script.lua
Created December 27, 2022 15:44 — forked from chanks/script.lua
Lua script to delete/trim all processed messages from a Redis stream - an updated version is maintained here: https://gist.github.com/FSX/fb86595c64751201497e2050aeb722e2
-- The goal of this script is to trim messages that have been processed by
-- all extant groups from the a given Redis stream. It returns the number
-- of messages that were deleted from the stream, if any. I make no
-- guarantees about its performance, particularly if the stream is large
-- and not fully processed (so a simple XTRIM isn't possible).
-- First off, bail out early if the stream doesn't exist.
if redis.call("EXISTS", KEYS[1]) == 0 then
return false
end
@HDegroote
HDegroote / replicate-hyperbees.js
Last active November 20, 2022 20:54
Replicating hyperbees over hyperswarm
// Uses hypercore-next and hyperswarm V4
// Server
const Hyperswarm = require('hyperswarm')
const Hypercore = require("hypercore")
const Hyperbee = require("hyperbee")
const ram = require("random-access-memory")
async function runServer(){
@tavianator
tavianator / remote
Created May 27, 2022 20:59
Remote access mkinitcpio hook
#!/bin/bash
add_user() {
getent passwd "$1" >>"$BUILDROOT/etc/passwd"
getent shadow "$1" >>"$BUILDROOT/etc/shadow"
getent group "$(id -Gn "$1")" >>"$BUILDROOT/etc/group"
}
build() {
add_systemd_unit cryptsetup-pre.target
@metasikander
metasikander / NIP-05_Simple_Guide.md
Last active February 13, 2024 20:09
A small minimal guide on setting up NIP-05 identifier on branle/nostr

This is a very basic guide, just to understand what's needed to set it up.
If you have any questions you can find me at https://nostr.com/8355095016fddbe31fcf1453b26f613553e9758cf2263e190eac8fd96a3d3de9

Prerequisite

Setup static file on server

Create a file that resolves to <domain>/.well-known/nostr.json, and fill it out like this (enter the name you want to use, and input your own public key, make sure its the HEX-key):

{

Blind Diffie-Hellman Key Exchange (blind ecash)

The goal of this protocol is for Bob to get Alice to perform a Diffie-Hellman key exchange blindly, such that when the unblinded value is returned, Alice recognizes it as her own, but can’t distinguish it from others (i.e. similar to a blind signature).

Alice:
A = a*G
return A

Bob:
Y = hash_to_curve(secret_message)
r = random blinding factor