Skip to content

Instantly share code, notes, and snippets.

@lottamus
lottamus / Apple XDR Display (P3-1600 nits unlocked)​.plist
Last active October 23, 2024 16:33
Apple XDR Display (P3-1600 nits unlocked)​ allows you to take full advantage of your Macbook Pro screen brightness, which defaults to 500 nits to save battery.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PresetST2084Capable</key>
<true/>
<key>PresetGTFStandardType</key>
<integer>0</integer>
<key>PresetExportVersion</key>
<integer>1</integer>
@lottamus
lottamus / set_cursor_default.sh
Last active August 25, 2024 21:06
Set cursor.app as the default application for file extensions
#!/bin/bash
# Function to check if duti is installed
check_duti() {
if ! command -v duti &> /dev/null; then
echo "duti is not installed. Installing duti..."
if command -v brew &> /dev/null; then
brew install duti
else
echo "Homebrew is not installed. Please install Homebrew first."
@lottamus
lottamus / outr-scheduler.ts
Created July 17, 2024 21:28
Use Cloudflare's Durable Object alarms to schedule outreach emails in the future
import { DurableObject } from "cloudflare:workers";
import * as zod from "zod";
interface Env {
SCHEDULER: DurableObjectNamespace<Scheduler>;
}
const schema = zod.object({
outrCampaignOutreachId: zod.string(),
outrCampaignOutreachSchedule: zod.number(),
@lottamus
lottamus / inbound-parse.ts
Created July 17, 2024 20:01
parses the email and forwards it to the appropriate recipient
import type {
ExportedHandler,
} from "@cloudflare/workers-types";
import PostalMime, { type Email } from "postal-mime";
/**
* This is the main entry point for the inbound email parsing service.
* It is triggered when an email is received at the inbound email address.
* It parses the email and forwards it to the appropriate recipient.
*/