Skip to content

Instantly share code, notes, and snippets.

View m1guelpf's full-sized avatar

Miguel Piedrafita m1guelpf

View GitHub Profile
@maple3142
maple3142 / CVE-2025-55182.http
Last active December 6, 2025 11:14
CVE-2025-55182 React Server Components RCE POC
POST / HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Next-Action: x
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Length: 459
------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="0"
@Archetapp
Archetapp / SplitView.swift
Last active November 2, 2025 21:32
A split view similar to Abode. (Added keyboard avoidance logic.)
import SwiftUI
// MARK: - Component
fileprivate struct SplitViewConfig {
let topDetentRatio: CGFloat
let bottomDetentRatio: CGFloat
let elasticThreshold: CGFloat
let elasticResistance: CGFloat
let snapThreshold: CGFloat
#include <metal_stdlib>
#include <SwiftUI/SwiftUI.h>
using namespace metal;
float2 distort(float2 uv, float strength) {
float2 dist = 0.5 - uv;
uv.x = (uv.x - dist.y * dist.y * dist.x * strength);
uv.y = (uv.y - dist.x * dist.x * dist.y * strength);
return uv;
@jsmmth
jsmmth / ContentView.swift
Last active July 26, 2025 18:59
SwiftUI Animated Dashed Border
import SwiftUI
struct AnimatedBorder: View {
@State private var phase: CGFloat = 0
let cornerRadius: CGFloat = 25
let dashPattern: [CGFloat] = [15, 15]
let lineWidth: CGFloat = 4
var body: some View {
ZStack {
@jsmmth
jsmmth / Swift UI StarField Experiment
Created July 13, 2025 15:46
Pretty messy, probably quite un-optimised fun SwiftUI star field experiment.
import SwiftUI
import MetalKit
import simd
// MARK: - Metal View
struct MetalStarfieldView: UIViewRepresentable {
@Binding var speed: Double
@Binding var cameraShake: CGSize
let hyperdriveCallback: () -> Void
@ariankordi
ariankordi / FFLTestingThumbProvider.cpp
Created July 13, 2025 01:29
Mii thumbnailer for Windows PoC using the FFL-Testing Mii renderer server
/**
* \file FFLTestingThumbProvider.cpp
* \author Arian Kordi (https://github.com/ariankordi)
* \date 2025/07/12
*
* \brief Windows thumbnail provider for Mii data files using
* the FFL-Testing Mii renderer server: https://github.com/ariankordi/FFL-Testing
* \details Requires setting up and running on default port of 12346.
* Not ideal for real use. Should be considered a proof-of-concept/toy.
* https://github.com/ariankordi
@samhenrigold
samhenrigold / q&a.md
Created June 11, 2025 02:07
WWDC25 Camera/Photos Group Lab Q&A

What’s the first class way to use PhotoKit to reimplement a high performance photo grid? We’ve been using a LazyVGrid and the photos caching manager, but are never able to hit the holy trinity (60hz, efficient memory footprint, minimal flashes of placeholder/empty cells)

A few things. It sounds like you're using the PHCachingImageManager already, which is definitely recommended.

One kind of specific note there—you want to use that to get media content delivered before you need to display it. So, for example, let's say you're showing a large grid of photos. You can be prefetching before and after, in expectation that the user's going to scroll. Or, if you're in a one-up situation, prefetching left and right so that you know the user is likely going to swipe, and you can quickly deliver those images to the screen and cache them.

Another thing you should really make sure you're doing is specifying the size you need for the grid size. For example, if your app supports showing a smaller grid

import UIKit
import CoreImage
public extension UIImage {
/// Draws a rounded, solid‐color outline around this image’s alpha shape,
/// then composites the full-color image back in the center.
///
/// - Parameters:
/// - strokeColor: the color of the ring
/// - strokeWidth: the thickness of the ring (in points)
@xlr8harder
xlr8harder / sydney.py
Created August 2, 2024 18:49
Talk to Sydney with Llama 3.1 405B base model.
import gradio as gr
from openai import OpenAI
import jinja2
from transformers import AutoTokenizer
# get an api key from hyperbolic.
api_key = "..."
# Initialize the OpenAI client
client = OpenAI(
@drewolbrich
drewolbrich / InputNotWorkingIndicator.swift
Last active August 11, 2024 03:33
A recreation of the Mac Virtual Display "Input temporarily not working" indicator
//
// InputNotWorkingIndicator.swift
//
// Created by Drew Olbrich on 6/26/24.
// Copyright © 2024 Lunar Skydiving LLC. All rights reserved.
//
// 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