Skip to content

Instantly share code, notes, and snippets.

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

skeptrune skeptrunedev

💭
🚢 🚢 🚢
View GitHub Profile
@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.

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 / 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 / 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
@aanari
aanari / set-alacritty-default.sh
Last active May 26, 2024 21:34
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