Skip to content

Instantly share code, notes, and snippets.

@martinbowling
martinbowling / google-doc-beter-image-options.js
Created May 28, 2024 01:43
Google Doc Inline Base64 Images or Sanely Named Images ZIP
function downloadDocWithImagesInZip() {
const doc = DocumentApp.getActiveDocument();
const docName = doc.getName();
const docBody = doc.getBody();
const zip = Utilities.newBlob('', 'application/zip', `${docName}.zip`).getAs('application/zip');
let content = '';
let imageCount = 0;
const totalElements = docBody.getNumChildren();
for (let i = 0; i < totalElements; i++) {
@martinbowling
martinbowling / Claude3-Opus-Chain-of-Though-HCU-Content-Classifier.xml
Created May 6, 2024 23:39
Claude3-Opus-Chain-of-Though-HCU-Content-Classifier
<prompt>
<html-content>
<!-- Paste the HTML content of the webpage here -->
</html-content>
Now that the HTML content of the webpage is provided above, please analyze the webpage and evaluate the following features to determine if the content is likely to be helpful based on Google's guidelines. For each feature, indicate "Yes" if the feature is present and "No" if it is not. Use the following chain of thought process for each feature:
1. Identify the specific HTML elements and attributes related to the feature within the provided HTML content.
2. Determine if the feature is present on the page based on the identified elements and attributes.
@martinbowling
martinbowling / one-shot-web-spam-classifier.xml
Last active May 5, 2024 22:57
One Shot Web Spam Classifier Claude 3 Opus
<prompt>
Please analyze the following 10 examples of web spam content and 10 examples of good web content:
Web Spam Examples:
<spam_example1>
[URL, title, meta description, h1, h2, h3, h4 for web spam example 1]
</spam_example1>
<spam_example2>
[URL, title, meta description, h1, h2, h3, h4 for web spam example 2]
</spam_example2>
...
@martinbowling
martinbowling / fix-homebrew-perms-via-curl.sh
Last active February 2, 2024 17:30
fixed macos homebrew permissions
curl -s https://gist.githubusercontent.com/martinbowling/5ad8213d17bfddc4dfb21579c92a4c05/raw/b6c7abacaec8be8e2b720ceceb0e745b6dbed5e0/fix-homebrew-perms.sh | bash
@martinbowling
martinbowling / googleMaps.js
Created September 13, 2023 00:37 — forked from adrianhorning08/googleMaps.js
Scrape Google Maps
import * as cheerio from "cheerio";
import puppeteerExtra from "puppeteer-extra";
import stealthPlugin from "puppeteer-extra-plugin-stealth";
import chromium from "@sparticuz/chromium";
async function searchGoogleMaps() {
try {
const start = Date.now();
puppeteerExtra.use(stealthPlugin());
@martinbowling
martinbowling / apollo.js
Created September 12, 2023 00:58 — forked from adrianhorning08/apollo.js
Apollo Scraper
function clickAccessEmailIfAvailable() {
const tbodys = document.querySelectorAll(
".finder-results-list-panel-content table tbody"
);
for (let i = 0; i < tbodys.length; i++) {
const tbody = tbodys[i];
const buttons = tbody.querySelectorAll("button");
// Create an array to store buttons with text including "Access Email"
const filteredButtons = [];
@martinbowling
martinbowling / googleJobs.js
Created August 12, 2023 01:56 — forked from adrianhorning08/googleJobs.js
Google Jobs Scraper
import * as cheerio from "cheerio";
import fs from "graceful-fs";
import puppeteerExtra from "puppeteer-extra";
import stealthPlugin from "puppeteer-extra-plugin-stealth";
import chromium from "@sparticuz/chromium";
(async function () {
console.log("starting");
let term = "marketing";
@martinbowling
martinbowling / linkedinJobs.js
Created August 12, 2023 01:56 — forked from adrianhorning08/linkedinJobs.js
Linkedin Jobs Scraper
import fetch from "node-fetch";
import fs from "graceful-fs";
import * as cheerio from "cheerio";
async function getJob(id) {
try {
const response = await fetch(
`https://www.linkedin.com/jobs-guest/jobs/api/jobPosting/${id}`,
{
// agent: getProxyAgent(), put proxy here
@martinbowling
martinbowling / article-gen.py
Created April 26, 2023 20:47
Rudimentary Article Generator with gpt 3.5 turbo api
import openai
import os
# Set up the API key
openai.api_key = "your_openai_api_key"
# Function to call GPT-3.5 Turbo API with chat completion
def generate_text(messages):
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
@martinbowling
martinbowling / avi-to-mp4.py
Created March 2, 2023 20:23
Multithreaded Python Script for AVI to MP4 conversion
import os
import multiprocessing
from pathlib import Path
import subprocess
# Specify the folder containing the .avi files
input_folder = Path("/path/to/avi/files")
# Create the subfolder for the converted files if it doesn't exist
converted_folder = input_folder / "converted"