This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # dfn: df normalized, or df not noisy, or df nicely, or df new | |
| # | |
| # Whatever you want to call it, this script makes df useful again. | |
| # It removes read-only disks for Time Machine backups, system volumes | |
| # that can't be modified, unbrowsable volumes, and other stuff you don't | |
| # really care about. | |
| # | |
| # Instead, you get the same drives that you see on your Mac desktop in an |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // OCXML.swift | |
| // Created by Marco Arment on 9/23/24. | |
| // | |
| // Released into the public domain. Do whatever you'd like with this. | |
| // No guarantees that it'll do anything, or do it correctly. Good luck! | |
| // | |
| import Foundation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use scripting additions | |
| use framework "Foundation" | |
| -- Set Configuration Defaults | |
| set OUTPUT_FILE to "~/now-playing.json" | |
| -- END Configuration | |
| on getCurrentTrack() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # This script resolves a DID, retrieves an API key, fetches a user's feed, | |
| # and posts a "Hello, world" message to the user's feed. | |
| # Resolve DID for handle | |
| HANDLE='felicitas.pojtinger.com' | |
| DID_URL="https://bsky.social/xrpc/com.atproto.identity.resolveHandle" | |
| export DID=$(curl -G \ | |
| --data-urlencode "handle=$HANDLE" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $completion = ""; | |
| if ($_SERVER["REQUEST_METHOD"] == "POST") { | |
| // Your OpenAI API key | |
| $apiKey = ''; | |
| // The message you want to send to OpenAI | |
| $message = $_POST['message']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| import AVKit | |
| // This extension is based upon https://www.thonky.com/qr-code-tutorial/data-encoding | |
| extension AVMetadataMachineReadableCodeObject | |
| { | |
| var binaryValue: Data? | |
| { | |
| switch type | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| A simple PHP class to perform basic operations against Amazon S3 and compatible | |
| services. Requires modern PHP (7+, probably) with curl, dom, and iconv modules. | |
| Copyright 2022 Marco Arment. Released under the MIT license: | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const $ = document.querySelector.bind(document); | |
| const $$ = document.querySelectorAll.bind(document); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "workbench.colorTheme": "Solarized Light", | |
| "editor.fontFamily": "Consolas, Menlo, Monaco, 'Courier New', monospace", | |
| "editor.insertSpaces": false, | |
| "editor.inlineSuggest.enabled": true, | |
| "editor.fontSize": 14.5, | |
| "editor.renderWhitespace": "boundary", | |
| "editor.codeLens": false, | |
| "editor.inlayHints.fontFamily": "Consolas, Menlo, Monaco, 'Courier New', monospace", | |
| "diffEditor.codeLens": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Convert an ArrayBuffer into a string. | |
| // From https://developers.google.com/web/updates/2012/06/How-to-convert-ArrayBuffer-to-and-from-String | |
| function arrayBufToString(buf) { | |
| return String.fromCharCode.apply(null, new Uint8Array(buf)); | |
| } | |
| function pemEncode(label, data) { | |
| const base64encoded = window.btoa(data); |
NewerOlder