Skip to content

Instantly share code, notes, and snippets.

markashleybell /
Last active Nov 13, 2022
Mastodon metadata proxy using a Cloudflare Worker

Inspired by this article by Maarten Balliauw, this Cloudflare Worker code enables a proxy for Mastodon metadata under your own domain, with a memorable alias.

This allows people to search for you under your own @user@domain alias, finding your account on whichever server it currently resides on. This has a lot of advantages when it comes to discoverability!

If you move servers, you can update the mastodonHandle value to reflect that; searching for the alias will then direct people to your account on the new server.

Example: search on your Mastodon server and you should find my account—if the search isn't currently broken because it's too busy. 😉

import os
import sys
import requests
from git import Repo
from string import Template
# Get the command-line arguments
user_type = sys.argv[1]
user_id = sys.argv[2]
markashleybell / github-mirror.ps1
Created Aug 10, 2019
Local GitHub repository backups with Powershell
View github-mirror.ps1
$initialWorkingPath = Convert-Path '.'
markashleybell / dropbox-db-backup.ps1
Last active Feb 16, 2021
Rolling backup of one or more SQL Server databases to Dropbox.
View dropbox-db-backup.ps1
function Upload-FileToDropbox {
markashleybell / crypto-aes-gcm.js
Created Apr 15, 2019 — forked from chrisveness/crypto-aes-gcm.js
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
View crypto-aes-gcm.js
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt().
* (c) Chris Veness MIT Licence
* @param {String} plaintext - Plaintext to be encrypted.
* @param {String} password - Password to use to encrypt plaintext.
* @returns {String} Encrypted ciphertext.
* @example
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw');
markashleybell / index.html
Created Apr 5, 2013
Queueing asynchronous functions in JavaScript so that each is executed after the previous function has completed; useful when lookup data or templates are required to be loaded before other code can be executed.
View index.html
<!DOCTYPE html>
<title>Queueing Asynchronous Functions in JavaScript</title>
<script src="//"></script>
<script type="text/javascript" src="queue.js"></script>
<p><input type="button" id="process-button" value="Process Queue" /></p>
<div id="output"></div>
View gist:1139238
<form id="demo2" action="" method="post">
<p class="mab-checkbutton-container">
<input type="checkbox" value="1" name="cb-1" id="cb-1" /> <label for="cb-1">Checkbox 1</label>
<input type="checkbox" value="1" checked="checked" name="cb-2" id="cb-2" /> <label for="cb-2">Checkbox 2</label>
<input type="checkbox" value="1" checked="checked" name="cb-3" id="cb-3" /> <label for="cb-3">Checkbox 3</label>
<p><input type="submit" value="Submit Form and Show Values" /></p>