Skip to content

Instantly share code, notes, and snippets.

View fatfingers23's full-sized avatar
๐ŸŒ
Hack the planet

Bailey Townsend fatfingers23

๐ŸŒ
Hack the planet
View GitHub Profile
@fatfingers23
fatfingers23 / BlueskyEmbedded.vue
Created May 30, 2025 18:05
Bluesky nuxt/embedded post
<script setup lang="ts">
defineProps< {
postAtUri: string,
}>();
const embeddedId = String(Math.random()).slice(2);
const iframeHeight = ref(100);
if (import.meta.client) {
window.addEventListener("message", function (event) {
if (event.origin == "https://embed.bsky.app") {
@fatfingers23
fatfingers23 / cache.rs
Last active September 7, 2023 04:40
Simple Actix cache with a TTL
use actix_web::web::Data;
use std::collections::HashMap;
use std::sync::Mutex;
use std::time::{Duration, Instant};
use tokio::time::sleep;
type CacheItem = HashMap<String, (Instant, String)>;
#[derive(Clone)]
pub struct Cache {
store: Data<Mutex<CacheItem>>,