Skip to content

Instantly share code, notes, and snippets.

View romyilano's full-sized avatar
😎
improving

Romy romyilano

😎
improving
View GitHub Profile
@Matt54
Matt54 / ImmersiveLaserPenMeasurementView.swift
Created October 27, 2025 03:20
Logitech Muse Laser Pen Scene Measurement (RealityKit & ARKit)
import ARKit
import CoreHaptics
import GameController
import RealityKit
import SwiftUI
struct ImmersiveLaserPenMeasurementView: View {
@State private var stylusManager = StylusLaserPenManager()
var body: some View {
@reduz
reduz / godot_vision_pro.md
Last active October 15, 2024 03:00
Godot on Vision Pro and similar devices

Vision Pro style API on Godot

Overview

Apple recently unveiled the Vision Pro. This type of device is mostly designed for augmented reality (AR), in the sense that it should be able to throw 3D models and rendering combined into a camera.

Normally with pass-through AR, one would expect to get the camera feed as an image and maybe some environment cubemap generated from the camera to apply proper lighting into the objects.

//
// CacheAsyncImage.swift
//
// Created by Costantino Pistagna on 08/02/23.
//
// Updated on 31/08/2025: This gist is really old. If you still need
// an easy drop-in replacement for AsyncImage, please check out my
// current SPM at:
//
// https://github.com/valvoline/CachedAsyncImage
@CGArtPython
CGArtPython / reading_and_writing_json_files.py
Last active March 9, 2025 06:14
Reading and Writing JSON Files for Blender Python Beginners (tutorial video: https://youtu.be/f6UoW5rtrw0)
# extend Python's functionality to work with JSON files
import json
# extend Python's functionality to work with file paths
import pathlib
# extend Python's functionality to print data in a readable way
import pprint
# give Python access to Blender's functionality
@sebj
sebj / Guide.md
Last active April 8, 2025 18:04
Add a scene delegate back to a SwiftUI Project

Define an application delegate

See also: UIApplicationDelegate documentation

// AppDelegate.swift
@main
final class AppDelegate: NSObject, UIApplicationDelegate {

    func application(
        _ application: UIApplication,
@carlynorama
carlynorama / CollapsableView.swift
Last active July 16, 2022 18:32
A container that collapses.
//Based off of https://rensbr.eu/blog/swiftui-escaping-closures/
struct CollapsableView<Content: View>: View {
let content: Content
@Binding var isVisible:Bool
init(value:Binding<Bool>, @ViewBuilder content: () -> Content) {
self.content = content()
self._isVisible = value
}
@Amzd
Amzd / ColorPicker.swift
Last active January 25, 2025 08:49
What SwiftUI's ColorPicker should have been.
import SwiftUI
@available(iOS 14.0, *)
public struct ColorPickerWithoutLabel: UIViewRepresentable {
@Binding var selection: Color
var supportsAlpha: Bool = true
public init(selection: Binding<Color>, supportsAlpha: Bool = true) {
self._selection = selection
self.supportsAlpha = supportsAlpha
import SwiftUI
import WebKit
import Combine
class WebViewData: ObservableObject {
@Published var loading: Bool = false
@Published var scrollPercent: Float = 0
@Published var url: URL? = nil
@Published var urlBar: String = "https://nasa.gov"
@abhi21git
abhi21git / ExtensionURLRequest.swift
Last active April 8, 2025 10:51
Swift cURL Printer
//
// ExtensionURLRequest.swift
//
// Created by Abhishek Maurya on 16/07/20.
// Copyright © 2020. All rights reserved.
//
import Foundation
extension URLRequest {
final class _TextFieldCoordinator: NSObject {
var control: _TextField
init(_ control: _TextField) {
self.control = control
super.init()
control.textField.addTarget(self, action: #selector(textFieldEditingDidBegin(_:)), for: .editingDidBegin)
control.textField.addTarget(self, action: #selector(textFieldEditingDidEnd(_:)), for: .editingDidEnd)
control.textField.addTarget(self, action: #selector(textFieldEditingChanged(_:)), for: .editingChanged)
control.textField.addTarget(self, action: #selector(textFieldEditingDidEndOnExit(_:)), for: .editingDidEndOnExit)