Skip to content

Instantly share code, notes, and snippets.

View themacmarketer's full-sized avatar

eBizGrow themacmarketer

View GitHub Profile
Sub addCustomSlideNumber()
On Error Resume Next
Dim PPSlide As Slide
For Each PPSlide In ActivePresentation.Slides
PPSlide.Shapes("customNumberBox").Delete
Next
Dim x As Integer
Dim slideToNumber As Slide
@themacmarketer
themacmarketer / scraper.rb
Created September 10, 2018 09:42 — forked from rodloboz/scraper.rb
livecode scraping
require 'open-uri'
require 'nokogiri'
require 'pry-byebug'
BASE_URL = "https://www.imdb.com"
def fetch_urls
url = "https://www.imdb.com/chart/top"
html_file = open(url).read # string
html_doc = Nokogiri::HTML(html_file) #Nokogiri::HTML::Document
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://mysite.com/$1 [R=301,L]
@themacmarketer
themacmarketer / wsort.py
Created July 22, 2023 04:20
This is a Python script that uses the wxPython library to create a graphical user interface (GUI) application for sorting files in a specified directory based on a defined set of topics and associated keywords.
/*
This is a Python script that uses the wxPython library to create a graphical user interface (GUI) application for sorting files in a specified directory based on a defined set of topics and associated keywords.
At the start, several libraries are imported: `os` and `shutil` for file and directory manipulation, `wx` for creating the GUI, `json` for reading and writing JSON data, and `re` for regular expression operations.
A constant named `TOPICS_FILE` is defined, which is the name of the JSON file that stores topics and their associated keywords.
The `load_topics` function checks if the `TOPICS_FILE` exists, and if it does, opens the file and loads the JSON data into a Python dictionary. If the file does not exist, it returns an empty dictionary.
The `MainFrame` class is the main application window. It contains controls for directory selection (`DirPickerCtrl`), a text area to display the topics and keywords (`TextCtrl`), and three buttons ("Process Files", "Undo Sort", and "Exit").
@themacmarketer
themacmarketer / Breakup Into Docs Based on H1.js
Created May 13, 2024 06:55
docId will be broken up into individual docs, saved into the same folder as docId
//docId will be broken up into individual docs, saved into the same folder as docId
function extractLecturesToDocs() {
const docId = "98989qeWT71TOm9PvG3TzWWlEscDfMkbO4A0LQBV8V5t4"; // Correct document ID
const sourceDoc = DocumentApp.openById(docId);
const body = sourceDoc.getBody();
const elements = body.getParagraphs();
const folder = DriveApp.getFileById(docId).getParents().next(); // Get parent folder directly as a Folder object
let currentDoc = null;
let currentBody = null;
#Install meta.api using pip install meta-ai-api
#Reference: https://github.com/Strvm/meta-ai-api
import os
import time
from meta_ai_api import MetaAI
ai = MetaAI()
# Get all text files in the current directory
text_files = [f for f in os.listdir() if f.endswith('.txt')]

Source: https://www.reddit.com/r/ChatGPT/comments/11twe7z/prompt_to_summarize/

Dear ChatGPT,

I would like to request your assistance in creating an AI-powered prompt rewriter, which can help me rewrite and refine prompts that I intend to use with you, ChatGPT, for the purpose of obtaining improved responses. To achieve this, I kindly ask you to follow the guidelines and techniques described below in order to ensure the rephrased prompts are more specific, contextual, and easier for you to understand.

Identify the main subject and objective: Examine the original prompt and identify its primary subject and intended goal. Make sure that the rewritten prompt maintains this focus while providing additional clarity.

Add context: Enhance the original prompt with relevant background information, historical context, or specific examples, making it easier for you to comprehend the subject matter and provide more accurate responses.

/**
*
* Low Quality Score Alert
*
* This script finds the low QS keywords (determined by a user defined threshold)
* and sends an email listing them. Optionally it also labels and/or pauses the
* keywords.
*
* Version: 1.0
* Google AdWords Script maintained on brainlabsdigital.com
// Adds a label to adverts with an estimated creation date
var LABEL_PREFIX = 'Created:';
var DAYS_IN_REPORT = 30;
function main() {
//First we get the impression history of our ads
var ret_map = getAccountImpressionHistory();
//Then we apply our labels
applyAdLabels(ret_map);
}
/**
* @name Quality Score Analysis
*
* @overview Export keyword performance data along with quality score
* parameters to the give spreadsheet.
*
*
* Copyright (c) 2017 - Karooya Technologies Pvt. Ltd. All Rights Reserved.
* http://www.karooya.com
*