This file contains 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 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 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 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 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 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 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 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 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); |
This file contains 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
/*! QRious v4.0.2 | (C) 2017 Alasdair Mercer | GPL v3 License | |
Based on jsqrencode | (C) 2010 [email protected] | GPL v3 License */ | |
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.QRious=e()}(this,function(){"use strict";function t(t,e){var n;return"function"==typeof Object.create?n=Object.create(t):(s.prototype=t,n=new s,s.prototype=null),e&&i(!0,n,e),n}function e(e,n,s,r){var o=this;return"string"!=typeof e&&(r=s,s=n,n=e,e=null),"function"!=typeof n&&(r=s,s=n,n=function(){return o.apply(this,arguments)}),i(!1,n,o,r),n.prototype=t(o.prototype,s),n.prototype.constructor=n,n.class_=e||o.class_,n.super_=o,n}function i(t,e,i){for(var n,s,a=0,h=(i=o.call(arguments,2)).length;a<h;a++){s=i[a];for(n in s)t&&!r.call(s,n)||(e[n]=s[n])}}function n(){}var s=function(){},r=Object.prototype.hasOwnProperty,o=Array.prototype.slice,a=e;n.class_="Nevis",n.super_=Object,n.extend=a;var h=n,f=h.extend(function(t,e,i){this.qrious=t,this.element=e, |
NewerOlder