Skip to content

Instantly share code, notes, and snippets.

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

skeptrune skeptrunedev

💭
🚢 🚢 🚢
View GitHub Profile
@skeptrunedev
skeptrunedev / obsidian_plugin_scrape.js
Created March 1, 2024 05:28
obsidian plugin scrape
let pluginsArray = [];
const pluginContainers = document.querySelectorAll('.p-5.flex.flex-col.rounded-lg.bg-secondary.transition-all.hover\\:shadow-2xl.hover\\:bg-gray-800');
pluginContainers.forEach((container) => {
const title = container.querySelector('.text-lg.mb-1.font-semibold.leading-tight')?.innerText.trim() || 'No title';
const authorNameElement = container.querySelectorAll('.text-muted.text-sm')[0];
const author_name = authorNameElement ? authorNameElement.innerText.trim() : 'Unknown Author';
@skeptrunedev
skeptrunedev / create_trieve_dataset.py
Created February 29, 2024 18:56
Create New Trieve Dataset With Python
import json
import os
import dotenv
import base64
import requests
import mimetypes
def to_base64(file):
try:
@skeptrunedev
skeptrunedev / trieve-file-upload.py
Created February 28, 2024 22:59
Upload a file to Trieve with Python
import json
import os
import dotenv
import base64
import requests
import mimetypes
def to_base64(file):
try:
@skeptrunedev
skeptrunedev / csv-uploader.py
Last active February 22, 2024 05:47
Trieve CSV iterator and uploader
import argparse
import io
import json
import os
import re
import string
import requests
import tiktoken
import pandas as pd
from dotenv import load_dotenv
@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);
}
@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 / 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 / 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 / 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 / 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()