This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import io | |
import json | |
import os | |
import re | |
import string | |
import requests | |
import tiktoken | |
import pandas as pd | |
import redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psycopg2 | |
from dotenv import load_dotenv | |
import os | |
import json | |
import requests | |
# Load the .env file | |
load_dotenv() | |
api_key = os.environ.get("API_KEY") | |
api_url = os.environ.get("API_URL") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psycopg2 | |
from dotenv import load_dotenv | |
import os | |
import json | |
import requests | |
# Load the .env file | |
load_dotenv() | |
origin_db_url = os.environ.get("ORIGIN_DB_URL") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn assemble_qdrant_filter( | |
current_user_id: Option<uuid::Uuid>, | |
tag_set: Option<Vec<String>>, | |
link: Option<Vec<String>>, | |
time_range: Option<(String, String)>, | |
filters: Option<serde_json::Value>, | |
quote_words: Option<Vec<String>>, | |
negated_words: Option<Vec<String>>, | |
) -> Filter { | |
let mut filter = Filter::default(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// alternative general quotes at https://raw.githubusercontent.com/JamesFT/Database-Quotes-JSON/master/quotes.json | |
// strongly recommend running the following with bun such that you do not have to import node-fetch | |
const quotes = JSON.parse( | |
await ( | |
await fetch( | |
"https://gist.githubusercontent.com/miharekar/d57b58b017c457cd18062a1c36d82e02/raw/76df8f30010456dceafe7d5f39357242410fe403/quotes.json" | |
) | |
).text() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// paste this into the console when viewing your skiff inbox | |
const elementToScroll = document.querySelector("#mailListElement > div.sc-irmRQO.iHuLQh > div > div:nth-child(1) > div"); | |
setInterval(() => { | |
console.log("paginating"); | |
elementToScroll.scrollTop = elementToScroll.scrollHeight; | |
}, 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
net::ERR_BLOCKED_BY_CLIENT | |
(anonymous) @ companies:18 | |
(anonymous) @ companies:33 | |
// i made this mini script because i am trying to collect the details of the existing public YC companies for a search demo with trieve | |
// with algolia, a search for "cloud storage" doesn't return Dropbox and a search for "bug monitoring" doesn't return PagerDuty, etc. | |
// find and build with trieve at github.com/devflowinc/trieve | |
// to use, navigate to https://www.ycombinator.com/companies and paste the following into the console | |
const sleepPromise = (ms) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import dotenv | |
import boto3 | |
dotenv.load_dotenv() | |
s3_endpoint = os.getenv("S3_ENDPOINT") | |
access_key = os.getenv("S3_ACCESS_KEY") | |
secret_key = os.getenv("S3_SECRET_KEY") | |
bucket_name = os.getenv("S3_BUCKET") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import dotenv | |
import boto3 | |
dotenv.load_dotenv() | |
s3_endpoint = os.getenv("S3_ENDPOINT") | |
access_key = os.getenv("S3_ACCESS_KEY") | |
secret_key = os.getenv("S3_SECRET_KEY") | |
bucket_name = os.getenv("S3_BUCKET") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mut dom = Html::parse_fragment(&document_without_newlines); | |
// remove tables from the HTML | |
let selector = Selector::parse("table").unwrap(); | |
let node_ids: Vec<_> = dom.select(&selector).map(|x| x.id()).collect(); | |
for id in node_ids { | |
dom.remove_from_parent(&id); | |
} |
OlderNewer