Skip to content

Instantly share code, notes, and snippets.

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

skeptrune skeptrunedev

💭
🚢 🚢 🚢
View GitHub Profile
@aanari
aanari / set-alacritty-default.sh
Last active October 16, 2024 18:35
Set Alacritty as Default Terminal Editor (Ubuntu)
sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator $(which alacritty) 50
sudo update-alternatives --config x-terminal-emulator
@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 / 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 August 30, 2024 10:36
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) => {
import { sleep } from "bun";
const secure_the_border_act_path = "./secure_the_border_act.txt";
const tax_relief_act_path = "./tax_relief_for_american_families_act.txt";
/// Here are two bills that we want to upload to Trieve
const bills = [
await Bun.file(secure_the_border_act_path).text(),
await Bun.file(tax_relief_act_path).text(),
];
@skeptrunedev
skeptrunedev / postgres-migration-status-and-kill.sql
Last active November 5, 2024 02:21
postgres-migration-status-and-kill.sql
-- the output of this command will have a table with a pid colummn
-- find the migration you want to stop and copy it's pid for step 2
SELECT *
FROM pg_stat_activity
WHERE state = 'active';
-- use the pid you copied from the previous output here instead of 7844
SELECT pg_cancel_backend(7844);
@skeptrunedev
skeptrunedev / access-gcloud-sql-with-port-forward.md
Created June 2, 2024 23:59
Access a gcloud SQL instance locally through port forwarding

First step is to list the available db's to figure out which one to describe and then copy the connectionName for.

gcloud sql instances list

Assuming the db you want is called foo you would then copy the connectionName as follows.

gcloud sql instances describe foo | grep connectionName | awk '{print $2}' | xclip -selection clipboard

Download cloud-sql-proxy here.

@skeptrunedev
skeptrunedev / trieve-tmuxp-load-config-guide.md
Last active July 2, 2024 12:16
Trieve tmuxp Load Config Guide

Trieve tmuxp Load Config Guide

Trieve consists of multiple different services and it is convenient to load them with tmuxp.

1. Start all required docker containers

You will need to enter the directory with the trieve repository with cd trieve from wherever you cloned.

Then, I recommend killing all your running docker containers with docker ps -q | xargs docker kill.