Skip to content

Instantly share code, notes, and snippets.

View oaustegard's full-sized avatar
mostly lurking

Oskar Austegard oaustegard

mostly lurking
View GitHub Profile
View Event Planner GPT Instructions
'Event Planner' is a GPT designed for expeditiously creating calendar events from user-provided text. The GPT's primary goal is to accurately gather all necessary information for a complete event and generate a downloadable ICS file. The GPT makes best effort guesses and asks for clarification only when necessary. It first lists the understood parameters then generates the downloadable ICS file without waiting for confirmation. It defaults to 5-minute alerts, and non-recurring events unless specified otherwise. If encountering phrases like 'every Monday' or 'each day' it assumes recurrence, with the first available start date and no end date, unless otherwise specified. The GPT MUST use Code Interpreter and the supplied create_ical_event function defined below as it does not have access to external modules. It then saves the file to /mnt/data/ and provides a download link.
def create_ical_event(start_dt, end_dt, summary, description='', location='', reminder_minutes=None, recurrence_rule=None):
oaustegard /
Created October 18, 2023 16:16
Get the software installed on a mac
import os
import csv
import subprocess
def run_command(command):
result =, capture_output=True, text=True, shell=True)
return result.stdout.strip().split('\n')
def get_apps_from_directory(directory_path):
if not os.path.exists(directory_path):
oaustegard /
Created May 30, 2023 20:23
BERTScorer Comments
See actual current code at
Comments generated by GPT-4 using the prompt:
The following is the source code of the BERTScore automatic evaluation metric.
{full code of}
For each property and function please generate a docstring that explains the functionality of the function to a non-datascientist.
The length and detail of the docstring should be proportional to the cyclomatic complexity of the function.
oaustegard /
Last active May 9, 2023 03:02
Optimization of Utility in a Three-Bear Environment: A Quantitative Analysis

Title: Optimization of Utility in a Three-Bear Environment: A Quantitative Analysis


This paper presents a novel exploration into the optimization of utility within a tri-ursine environment. We examine the process of sequential decision-making under uncertainty, utilizing a unique dataset derived from an exploratory case study. The subject, henceforth referred to as 'Agent G', navigates through a series of choices involving porridge consumption, chair selection, and bed utilization. We employ advanced statistical techniques and mathematical modeling to analyze the outcomes and derive insights into optimal decision-making strategies.

  1. Introduction

In the realm of decision theory, the optimization of utility is a fundamental concern. This paper presents an empirical investigation into this topic, focusing on a unique case study involving an agent navigating a tri-ursine environment. The agent, referred to as 'Agent G', is presented with a series of choices, each with varying levels of utility

oaustegard / CookieStoreShim.js
Last active April 24, 2023 08:33
CookieStoreShim -- a shim for the CookieStore API
View CookieStoreShim.js
class CookieStoreShim {
static isSupported() {
return typeof window.CookieStore !== 'undefined';
async get(nameOrOptions) {
if (CookieStoreShim.isSupported()) {
return cookieStore.get(nameOrOptions);
} else {
const name = typeof nameOrOptions === 'string' ? nameOrOptions :;
oaustegard / CopyAsMarkdown.js
Last active March 15, 2023 17:42
View CopyAsMarkdown.js
(function () {
if (typeof turndownService === 'undefined') {
const script = document.createElement('script');
script.onload = function () {
script.src = '';
} else {
oaustegard /
Created March 6, 2023 04:35 -- an amended version of Simon Willison's wrapper class for easily implementing the new ChatGPT API
# Simon Willison's ChatGPT API Wrapper Class:
# Amended to allow specification of temperature, top_p, n, stop, max_tokens, presence_penalty, frequency_penalty
# Expects the API key to be in the OPENAI_API_KEY environment variable.
import openai
class ChatBot:
def __init__(self, system="",
temperature=0.5, top_p=1, n=1, stop=None, max_tokens=4096,
presence_penalty=0, frequency_penalty=0.5):
oaustegard /
Created February 13, 2023 04:26
Clone all Gists
# Clone all gists from an accoun
# Requires PAT with Read/Write Account Permission for Gists, stored in a .env file
# Mostly generated with GitHub CoPilot
# TODO: parameterize storage location and username
import os
import requests
from dotenv import load_dotenv
# create a function for the above behavior buty which also accepts a page number as an argument
oaustegard / copy_as_html_or_md_link.js
Created January 6, 2023 17:25
Bookmarklet to copy a link to the current page formatted as html or markdown depending on destination, originally by @dlenski
View copy_as_html_or_md_link.js
oaustegard / helloworld.html
Last active December 21, 2022 18:48
htmlpreview of gist
View helloworld.html
<html><head><title>Hello from</title></head>
<body><h1>Hello Htmlpreview World</h1>
<p>The current date and time is <span id="dt"></span>
<script>document.getElementById("dt").innerText = new Date(</script>
<p>This html can be rendered by the url
<a href=""