Skip to content

Instantly share code, notes, and snippets.

View MrJarnould's full-sized avatar

Jacob Arnould MrJarnould

View GitHub Profile
@0xc1c4da
0xc1c4da / lmql_babyagi.py
Created August 19, 2023 11:27
Basic BabyAGI Implementation in LMQL
import lmql
from dataclasses import dataclass
from typing import List
# Data Structures
@dataclass
class Task:
task: str
# result: str
@jcxia43
jcxia43 / monaco-editor-for-function-call.js
Last active July 18, 2024 17:54
Add the OpenAI function call schema validation to monaco-editor
// OpenAI function call guide: https://platform.openai.com/docs/guides/gpt/function-calling
// JSON Schema reference: https://json-schema.org/understanding-json-schema/
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
validate: true,
schemas: [
{
uri: "http://myserver/foo-schema.json",
fileMatch: ["*"],
schema: {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@0xdevalias
0xdevalias / chatgpt-api-export.md
Last active May 30, 2024 23:57
Exploring ChatGPT API's for exporting all history as markdown, etc.
@jdesrosiers
jdesrosiers / schema.json
Created June 26, 2022 21:52
Customizable refactor of draft-07 meta-schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://example.com/my-custom-draft-07/schema#",
"title": "Core schema meta-schema",
"allOf": [{ "$ref": "#/definitions/schema" }],
"$comment": "Add constraints here that should only apply to root schemas and not sub-schemas",
"definitions": {
"schema": {
@Pezmc
Pezmc / fake-scan-automator.sh
Last active July 9, 2024 18:51 — forked from andyrbell/scanner.sh
Make a pdf look scanned with macOS automator as a quick action
#!/bin/bash
# This script takes a PDF or list of PDFs and outputs a file(s)
# named <file>_scanned.pdf that looks like it has been scanned
#
# Requires imagemagic and popper to be installed (brew install imagemagick poppler)
#
# Accepts: a list of files
# Usage: ./<scriptfilename> pdf1.pdf pdf2.pdf
#
# To use as a macOS automator quick action you need to:
@doitian
doitian / jxaClipboard.js
Created December 25, 2019 08:04
[Javascript for Automation ➤ Clipboard Parser] Access rich information about the clipboard #macOS #automation
ObjC.import('AppKit');
function pboardTypes() {
return ObjC.deepUnwrap(
$.NSPasteboard.generalPasteboard.pasteboardItems.js[0].types
);
}
function pboardUnpacked(strType) {
@dropmeaword
dropmeaword / browser_history.md
Last active July 19, 2024 00:09
Playing around with Chrome's history

Browser histories

Unless you are using Safari on OSX, most browsers will have some kind of free plugin that you can use to export the browser's history. So that's probably the easiest way. The harder way, which seems to be what Safari wants is a bit more hacky but it will also work for other browsers. Turns out that most of them, including Safari, have their history saved in some kind of sqlite database file somewhere in your home directory.

The OSX Finder cheats a little bit and doesn't show us all the files that actually exist on our drive. It tries to protect us from ourselves by hiding some system and application-specific files. You can work around this by either using the terminal (my preferred method) or by using the Cmd+Shft+G in Finder.

Finder

Once you locate the file containing the browser's history, copy it to make a backup just in case we screw up.