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.
@mfehrenbach
mfehrenbach / chrome-device-dimensions.md
Last active April 19, 2025 21:42
Modern device dimensions for Chrome DevTools.

Modern Device Dimensions for Chrome DevTools

These are modern “Emulated Devices” (a.k.a. responsive dimensions) for Chrome DevTools’ Mobile Device Viewport Mode.

They are specifically Apple devices, subtracting for recent Safari UI (as in window.innerWidth/Height), and cleverly sorted with some dark-arts unicode shenanigans. (This glitchy, unloved portion of the tools sorts lexicographically, because of course it would.) Ergonomics!

before-after

Nest Hub Max? Come on. I dropped a bunch of devices that were older and/or close to these dimensions. It obviously doesn’t cover everything (sorry Android/Chrome), but offers a decent spread/increments for common 2023/2024 viewports.

@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 September 30, 2024 02:59 — 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:
@syncom
syncom / mutt-with-gmail-gpg-macosx.md
Last active January 30, 2025 05:47
Configure Mutt to work with Gmail + GPG on MacOS X and Linux

Mutt (or NeoMutt) with Gmail and GPG, Mutiple Accounts

This note describes how to set up the Mutt or NeoMutt email client to work for Gmail and GnuPG, for two Gmail accounts. The method can be trivially extended to more than two accounts. The configuration should work for both macOS and Linux.

Software versions

@tanaikech
tanaikech / submit.md
Created January 9, 2020 02:27
Running Google Apps Script by Event Notification from Google Calendar

Running Google Apps Script by Event Notification from Google Calendar

Overview

This is a simple method running Google Apps Script by the event notification from Google Calendar.

Description

There are several event triggers in Google Apps Script. Ref1, Ref2 There is an event trigger for Google Calendar. The official document says An installable calendar event trigger runs when a user's calendar events are updated—created, edited, or deleted.. Ref3 If I want to use the trigger when the event in the calendar is starts and finished, it is required to use Calendar API by preparing the URL for receiving from Google. Ref4, Ref5 Also, there is the method t

@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) {