Skip to content

Instantly share code, notes, and snippets.

View heaversm's full-sized avatar

Mike Heavers heaversm

View GitHub Profile
@heaversm
heaversm / scp-server-local.md
Created February 16, 2024 16:06
SCP Copy between server and local computer

COPY FILES BETWEEN YOUR SERVER AND LOCAL COMPUTER

In terminal, on local machine, run:

FROM REMOTE TO LOCAL

scp -r ssh_user@ssh_host_ip:/var/www/foldername ~/Desktop/foldername

FROM LOCAL TO REMOTE

@heaversm
heaversm / chatbot-ai-debate-explainer.md
Created January 24, 2024 20:57
Chatbot AI Debate Explainer
@heaversm
heaversm / podquest-scraper-initial.js
Created December 20, 2023 01:04
chatGPT generated puppeteer scraper code
const puppeteer = require('puppeteer');
async function fillForm(data) {
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
for (const item of data) {
await page.goto('YOUR_WEBPAGE_URL'); // Replace with your webpage URL
// Click the first "Select" button
@heaversm
heaversm / podquest-scraper-final.js
Created December 20, 2023 01:02
Puppeteer Scraper for Podquest
//import puppeteer
import puppeteer from 'puppeteer';
async function muiSelectOption(page, buttonSelector, optionValue) {
let liComponent;
let selectorSubstr = buttonSelector.substring(1); // Remove the leading '#' or '.'
if (optionValue) {
liComponent = `li[data-value="${optionValue}"]`;
} else {
liComponent = 'li:first-child';
@heaversm
heaversm / scraping-google-with-langchain-agents.js
Last active January 5, 2024 22:16
Run a langchain agent that scrapes google
import { OpenAI } from 'langchain/llms';
import { initializeAgentExecutorWithOptions } from 'langchain/agents';
import { SerpAPI } from 'langchain/tools';
const tools = [
new SerpAPI(
'[YOUR_API_KEY]'
),
];
@heaversm
heaversm / ragfusion-node.js
Last active February 2, 2024 02:10
RAGFusion Node / Javascript Implementation
//RRF App Backend
//import node / express dependencies
import express from "express";
import path from "path";
//you'll need a '.dotenv' file in the root with the following variable:
//OPENAI_API_KEY="[YOUR_OPENAI_API_KEY_HERE]"
import dotenv from "dotenv";
@heaversm
heaversm / startup-marketing-checklist.md
Created December 28, 2022 17:08
Startup Marketing Checklist

Pre-Launch

Marketing starts long before you launch. Market research, planning, and preparation are critical parts of any marketing strategy.

Competitor Research

I have been up against tough competition all my life. I wouldn't know how to get along without it. - Walt Disney

@heaversm
heaversm / co2fromeventflights.js
Created October 25, 2022 02:50
all-company-trip co2 estimator
let totalPeopleInDirectory = 0;
let peopleWithUnknownLocation = 0;
let numLocations;
const locations = [];
const addPersonToTotal = function () {
totalPeopleInDirectory += 1;
};
const addToPeopleWithUnknownLocation = function () {
@heaversm
heaversm / docker-compose.yml
Created August 30, 2022 16:07
Docker Compose Running Cypress Tests
version: '3'
services:
# the client container, running webpack and the dev server
client:
image: path_to/image
networks:
- allhosts
volumes:
@heaversm
heaversm / regex-wrap-inside-tags.md
Last active August 9, 2022 16:30
regex: wrap all text inside matching tags
  • Find: <p class="italic text-center">(.+?)<\/p>
  • Replace: <p class="italic text-center"><time class="dt-published" datetime="$1">$1</time></p>
  • Example: <p class="italic text-center">03/01/2015</p>
  • Result: <p class="italic text-center"><time class="dt-published" datetime="03/01/2015">03/01/2015</time></p>