RSSAmplifier

Blog

Miguel Piedrafita

I'm a 24-year-old maker, and I love building things.

miguel.buildRSS feed ↗194 posts

Latest posts

Bringing World ID to Agents

With more and more agents browsing the internet, telling bots acting on behalf of a human apart from crawlers & other undesirable bots will become increasingly important. I've been working on using World ID to provide websites with a proof that a human is behind bot requests. It's out as a developer preview today! Read more

Playwright for Swift

I've been working on a personal data dashboard, joining together tons of data sources to get a full picture of my life. One of the sources I wanted was my YouTube Watch Later, which you can't retrieve from the API. I have gone to extreme lenghts in the past to avoid using Python, and this time was no different. After a week of intense rewriting, you can now use Playwright from Swift :D

Pokemon Go, but for payphones (?)

Riley Waltz recently launched a new game where you go out and hunt down California payphones . I happened to be in SF and wanted to join in on the fun, but copying directions over and over became a bit of a chore. So I dug up an unreleased project from last year (bike app for Lisbon) and put together a simple app that lets you see your closest phones and navigate to them in one click. Check out…

A brand new World ID (RFC)

It's not often you need to update a protocol. World ID has mostly stayed the same since we first designed it in 2021, and that's because it's great at doing the one thing it's supposed to do (let you anonymously prove you're a human). Four years later, we want to give it a few extra super-powers, like allowing anyone to issue their own credentials using the protocol. We'd love to hear your…

Speeding up the Cloudflare dashboard

I use Cloudflare to power a ton of things (including the video above!), but still dread having to go to the dashboard. It's soooo slow. To make my life a bit better, I built a lil CLI tool that deep-links into specific pages, cutting down the time it takes me to get places by a ton. View on GitHub

A lil website to show some of my favourite clothes

One of my goals for last year was to develop a better sense of personal style and wardrobe. I'm very happy with where I ended up, and after seeing miguel dot clothing was available, I couldn't help it but build a lil site to highlight some of my favourite pieces!

A game to keep up with the news

A few days ago, I found a really cool game which turns the news into simple games (trivia & letter unscrambling). Originally a web app with a really nice design, I took it as a challenge to recreate it as a native iOS app. This is the result! Play Timelines on the web

Navigation primitives for SwiftUI

Noticed that I kept copying a set of navigation helpers I built for Pocket to any other iOS app I started, so I took some time to clean them up and extract them into a Swift package.

Exploring Spotify's leaked data

Last week, a group of archivists managed to scrape a ton of data from Spotify (including user playlists and, most excitingly, music files). To explore the data (and figure out which of my favorite songs were in there), I built a website that lets you sign in with your Spotify account and navigate the dump easily.

Turning photos into 3D environments

Apple recently released an experimental ML model called sharp , which generates gaussian splatting scenes from a single image. I wanted an easier way to play with it, so I spent some time compiling the model to CoreML and building a simple macOS app to interact with it.

Decentralized gift-giving on World App

This year's holiday release of World App comes with a whimsical feature: the first global, human-only gift exchange. We put a lot of love into the experience, so it sort of feels like opening a real gift. Try it out

A native app for Overseerr

For the last few months, I've been working on an iOS app for Overseerr, an open-source project that helps you maintain a self-hosted media server. This has been my first "real" app to make, completely by myself, start to finish, and I'm incredibly proud of how it turned out. If you use Overseerr, give it a try! View on the App Store

Rendering Miis

The other day I stumbled upon a C++ decompilation of the Wii U library that renders Miis. I don't have a ton of experience with C++, but after a few hours of trial and error, I managed to run it on my Mac (it needed porting from OpenGL to Metal) and update the render function to give me full-body renders instead of just heads.

A Swift SDK for Sora

import VideoAPI let client = VideoAPI(authToken: YOUR_OPENAI_AUTH_TOKEN) let video = try await client.create( prompt: "A cute cat playing with a ball of yarn", model: .sora2Pro ) I was invited to OpenAI DevDay this year, where the new Sora APIs got announced. To play around with them, I built a simple Swift SDK that makes it super easy to integrate AI video generation into your iOS and macOS apps.…

The best OpenAI DevEx in Swift

I spent most of the summer updating my OpenAI Responses Swift library to support the latest API changes and make it as developer-friendly as possible. Some of the highlights include schema-generating macros to massively reduce function-calling boilerplate, and updating the Conversation utility to handle everything you could ever need. Try it out!

Glass icon for an upcoming app

I've been working on an app called Pocket, which helps you manage your media server (more on that soon!). Of course, every app needs a cool icon, and I was very happy with how this one turned out.

Cleaning up my Twitter followers

One of the bad things about having a large Twitter following is that, over time, you end up with a lot of inactive or spammy accounts following you. Aside from being annoying, this was starting to make my tweets not show up on people's timelines. To fix this, I downloaded a list of everyone that followed me, and spent a few days writing scripts to get rid of obvious bots and spammy accounts. The…

Real-time AI in two lines of code

import SwiftUI import RealtimeAPI struct ContentView: View { @State private var conversation = Conversation() var body: some View { Text("This is all you need for interactive AI in your app!") .task { try await conversation.connect( ephemeralKey: YOUR_EPHEMERAL_KEY_HERE ) } } } OpenAI released a new version of their Realtime API recently, so I took the chance to completely rewrite my old Swift SDK…

Standard Webhooks for Swift

I recently learned about the Standard Webhooks spec , a set of standards for properly verifying and parsing webhooks. There are official SDKs for a bunch of languages, but not Swift, and I needed to validate OpenAI's webhooks (which follow the standard) on a Swift server, so I ended up building a package that handles both signing and verifying.

A skeumorphic voice journal

A few weeks ago, my girlfriend and I challenged ourselves to make an app that didn't look or feel like an iOS app. To achieve this, she designed the app using vector graphics instead of a UI framework, while I added haptics and other affordances to make it feel as familiar as possible. I'm obviously biased, but i think it turned out great. Try it out! Download on the App Store

A better DX for Rive data binding on iOS

While working on a new app, I had to use the Rive iOS runtime for some graphics, and didn't love the way you had to manually declare all the properties and types. To fix this, I built an Xcode plugin that automatically parses Rive files and generates all the types. It's just a proof of concept right now, but hopefully will eventually get pulled in!

The Nintendo DS Clock, on your phone

I've been feeling a bit nostalgic for old consoles recently, with the Switch 2 finally dropping this week. To celebrate, my girlfriend and I spent the weekend recreating the original Nintendo DS clock as an iOS widget. It's now live on the App Store! Download on the App Store

World is now live in the US

Ethereum (@ethereum) on Twitter: Ethereum is for humans. After many months of work, World launches in the US! See the tweet above for some highlights of what we launched, included some things I built! 😁

Massively simplifying AWS Nitro Enclaves

We've been exploring TEEs at work recently, and while it's really cool you can run any Rust code in them, the experience is full of rough edges. After figuring out the best way to do a bunch of essential things, I decided to compile them all into an open-source crate that others can take advantage of.

A Swift SDK for the OpenAI Images API

import OpenAlImages let client = ImagesAPI(authToken: OPENAI_API_KEY) let response = try await client.create(prompt: "A cute cat") let response = try await client.edit( image: .url( Bundle.main.url(forResource: "image", withExtension: "png"), format: .png ), prompt: "Change the color of the sky" ) OpenAI finally made their latest image generation model available through the API! I'm planning to…

A library to let AI take over your computer

let agent = Agent(model: .aceSmall, apiKey: "sk_...") let computer = Computer() let session = agent.start("Star the GeneralAgentsKit github repository") var observation = try await computer.observe() while true { let action = try await session plan(observation: observation) print("Executing: \(action)") if action.kind == .stop { break } observation = try await computer.execute(action) } I've been…

Imagining an app that turns your friends into stickers

OpenAI just released an incredibly update to their image generation tooling, and I've had a blast playing with all the different styles. One of my favorites was the "Sticker" style, and even though there's not an API for it yet, I thought I'd try my hand at designing how it could look like.

Making AI-powered iOS apps effortless

import OpenAI import SwiftUI struct ChatView: View { @State var newMessage: String = "" @State var conversation = Conversation(authToken: OPENAI_KEY, using: .gpt4o) var body: some View { VStack(spacing: 0) { ScrollView { VStack(spacing: 12) { ForEach(conversation.messages, id: .self) { message in MessageBubble(message: message) } } } TextField("Chat", text: $newMessage) .frame(height: 40)…

A Rust SDK for the OpenAI Responses API

use openai_responses::{Client, Request, types::{Input, Model}}; let response = Client::from_env()?.create(Request { model: Model::GPT4o, input: Input::Text("Are semicolons optional in JavaScript?".to_string()), instructions: Some("You are a coding assistant that talks like a pirate".to_string()), ..Default::default() }).await?; println!("{}", response.output_text()); OpenAI released a new API…

Disappearing Text Effect

Saw a particularly neat effect on the Devouring Details website, where your email vanishes after you subscribe to the newsletter. After playing around for a few hours, I managed to recreate it perfectly! View on GitHub

Love or Bot

For Valentine's Day, I built a game where you are shown a bunch of photos, and need to figure out if they are real or AI-generated. It's harder than it looks, try it out! Play on World App

React Server Actions, for PHP

import { php } from '@/lib/php' // [!code focus] import { startTransition, useState } from 'react' const ExamplePage = () => { const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [response, setResponse] = useState(null) // [!code focus:9] const signIn = php` use Illuminate\Support\Facades\Auth; function (string $email, string $password) {…

A lightweight pipeline system for Swift.

import Pipeline; try Pipeline.send(project).through( .pipe(BuildProject(), .pipe(UploadProject(), .pipe(DeployProject()), .fn { project in // ... return project } ))).run() I recently attended LaraconEU, where I watched a talk going over all the things that Laravel's relatively-simple Pipeline class makes so much easier. It felt like the kind of thing that could come in handy in the future, so I…

A simple Swift library for watching over your Mac

import AppKit import WatchEye import Foundation class ExampleWatchEyeDelegate { let watchEye: WatchEye init() { watchEye = WatchEye() watchEye.delegate = self } } extension ExampleWatchEyeDelegate: WatchEyeDelegate { func watchEyeDidReceiveAccessibilityPermissions(_: WatchEye) { print("Accessibility permissions granted!") } func watchEye(_: WatchEye, didFocusApplication app: NSRunningApplication)…

A video about falling asleep

It's been way too long since I made a video, especially with it being one of my main goals right now. I worked on this one in the last few weeks of 2024 hoping to release it before the year ended, but ended up going a little over. Still, I'm super happy with it and I think you'll love it!

A nice SwiftUI landing screen

Thought I'd build a very simple HomeKit controller app during Christmas, then spent most of the time building the first splash screen for the app instead of the actual app. looks pretty nice tho!

A modern Swift SDK for OpenAI's Realtime API

The newly-released Realtime API from OpenAI bring almost real-time voice capabilities, and mobile apps are some of the best use cases for this new capability. To make building these apps as easy as possible, I'm working on a super simple SDK for iOS, which lets you build full-fledged voice chat apps in less that 60 LoC (including the UI!).

Making OpenAI's new APIs production-ready

use axum::{extract::WebSocketUpgrade, response::IntoResponse, routing::get, Router}; #[tokio::main] async fn main() { let app = Router::new().route("/ws", get(ws_handler)); let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); axum::serve(listener, app).await.unwrap(); } async fn ws_handler(ws: WebSocketUpgrade) -> impl IntoResponse { // check for authentication/access/etc.…

Deploying Laravel apps from GitHub Actions

I've been slowly coming back to the Laravel world, and wanted an easy way to deploy open-source apps to my server from GitHub Actions. SSH'ing in didn't feel like the safest, so I built the system where the server is in control of the entire flow, while the still gets real-time logs streamed in. Self-hosted zero-downtime deployments for all!

Polishing up this site

Last week, I updated some of the animations on the site and, while making sure everything looked great, noticed things were running concerningly slow. To make things smoother, I migrated the site from Next.js to Astro , which let me strip most of the JS in the site (with little "islands" of interactivity). It now loads much faster!

Named routes for server-side Swift

Continuing my exploration of server-side Swift, I've built a small library that lets you name your Vapor routes, providing a nicer way to generate URLs. I also managed to make it compatible with a JS library, so you can generate URLs on your frontend as well!

Explaining SMPC in 12 minutes

Worldcoin recently announced a groundbreaking SMPC implementation, used to secure the biometric data captured by the Orb. To accompany the announcement, I flew to Poland to get a lil maths lecture from Remco covering the basics of SMPC and turn it into a video, so everyone can get a feel for how it works.

A better way to organize AI prompts in Rust

use prompt_organizer::prompt; prompt!{my_custom_prompt, r#" You are {name}, {user}'s AI assistant. When responding to a message, you add "quotes" around the message and sign it with your name. Make sure that the message is correctly formatted, and that the user's name is always capitalized. "#} // ^ expands to: // pub fn my_custom_prompt(name: &str, user: &str) -> String { // // returns…

An app to easily find liked tweets

After the thousandth time going "let me find that tweet real quick" just to never find it, I decided to do something about it. Perch lets you filter all your liked tweets by author, keyword, links, the kind of media they contain and more, so you can always go back to anything you've seen. Download on the App Store

Reverse-engineering my 3D printer's API

use bambulab_cloud::cloud::{Client, Region}; let client = Client::login(Region::Europe, "email@example.com", "password").await?; let tasks = client.get_tasks().await?; dbg!(tasks); // [src/main.rs:6] tasks = [ // Task { // id: 67318297, // length: 2783, // weight: 81.66, // cost_time: 6541s, // cover: Url { ... }, // end_time: 2024-04-06T01:51:58Z, // start_time: 2024-04-05T23:56:48Z, //…

Exploring server-side Swift

I've been having a lot of fun with Swift recently, so when I discovered there's a Swift Laravel-like web framework, I had to give it a try. I decided to rebuild the end-to-end encrypted bridge that Worldcoin uses to connect to the World App, and was surprised to find it took 70% less code for pretty much the same app, and with a much better DX! Will definitely be using it in the future.

A deep-dive into the Orb's source

Worldcoin recently open-sourced the Rust codebase that powers the Orb. To make contributing and browsing through the code easier, I sat down with some of the core contributors for an "improvised interview" of sorts, where they walked me through the overall structure. Read the announcement

Bringing a calmer feed to life

Scrolling through Twitter, I found a pretty sick text-only Twitter concept . I've been looking for excuses to practice my SwiftUI skills, so I took it as a challenge and turned it into a real app, adding a few fun things along the way like dithered images and a super smooth tab bar microinteraction. View on GitHub

My first SwiftUI app

After years of putting it off, I finally got to learning SwiftUI. This first app is a very simple "talk with AI" interaction, inspired by a demo from OpenAI's DevDay a few months ago. It's extremely simple, but I'm super happy with how it turned out! View on GitHub

A Rust SDK for World ID

Most of the World ID integrations so far have been on the web or mobile, since that's what we have SDKs for. For everyone else, I took a stab at building a Rust crate (which can be called from Swift, Python, etc.) that can serve as a more universal bridge to the protocol. View on GitHub