Skip to content

Instantly share code, notes, and snippets.

View skeptrunedev's full-sized avatar
💭
🚢 🚢 🚢

skeptrune skeptrunedev

💭
🚢 🚢 🚢
View GitHub Profile
@skeptrunedev
skeptrunedev / sentence_email_chunker.py
Last active October 15, 2023 21:06
python chunker for emails and other content that goes line by line
import argparse
import io
import json
import os
import re
import string
import requests
import tiktoken
import pandas as pd
import redis
@skeptrunedev
skeptrunedev / arguflow_migrate_server.py
Last active November 30, 2023 07:31
Python script to migrate one Arguflow instance to another using postgres of origin instance only
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")
@skeptrunedev
skeptrunedev / dedup_pg.py
Created November 30, 2023 22:01
python script to dedup a database by column
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")
@skeptrunedev
skeptrunedev / qdrant_filter_function_arguflow.rs
Created December 1, 2023 17:23
Arguflow Qdrant Filter Function Rust
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();
@skeptrunedev
skeptrunedev / arguflow_test_stoic.js
Last active December 4, 2023 07:29
Test Arguflow Search With Stoicism Quotes
// 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()
@skeptrunedev
skeptrunedev / skiff-scroll-script.js
Created January 14, 2024 18:18
skiff scroll for selecting all emails to export
// 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);
@skeptrunedev
skeptrunedev / yc-directory-scape.js
Last active May 23, 2024 01:43
YC Companies Directory Scraper (paste into console)
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) => {
@skeptrunedev
skeptrunedev / upload_image_dir_to_s3.py
Created February 13, 2024 05:51
upload image directory to s3
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")
@skeptrunedev
skeptrunedev / s3-image-upload.py
Last active February 22, 2024 00:54
s3-image-upload.py
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")
@skeptrunedev
skeptrunedev / remove-table-elements.rs
Created February 21, 2024 06:05
Rust html5ever Scraper Crate Code To Remove table elements
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);
}