Skip to content

Instantly share code, notes, and snippets.

View romyilano's full-sized avatar
😎
improving

Romy romyilano

😎
improving
View GitHub Profile
@reduz
reduz / godot_vision_pro.md
Last active March 14, 2024 08:48
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.

@CGArtPython
CGArtPython / reading_and_writing_json_files.py
Last active March 13, 2024 21:34
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 11, 2024 00:08
Add a scene delegate back to a SwiftUI Project

Define an application delegate

See also: UIApplicationDelegate documentation

// AppDelegate.swift
@UIApplicationMain
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 April 19, 2024 18:42
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 February 19, 2024 12:23
Swift cURL Printer
//
// ExtensionURLRequest.swift
//
// Created by Abhishek Maurya on 16/07/20.
// Copyright © 2020. All rights reserved.
//
import Foundation
extension URLRequest {
@gokhanakkurt
gokhanakkurt / converter.swift
Last active July 30, 2023 18:08
Currency Converter in Swift
struct ServiceResources {
static let exchangeUri = "https://api.exchangeratesapi.io/latest"
}
enum Currency: String {
case euro = "EUR"
case pound = "GBP"
case dollar = "USD"
case turkishLira = "TRY"
@excenter
excenter / rune.bash
Created November 30, 2018 04:35
Mojave pyenv update
export VERSION="3.7.1"
xcode-select --install
brew update
brew upgrade
brew install zlib
brew reinstall zlib
export LDFLAGS="-L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include"
pyenv install $VERSION
pyenv global $VERSION
@myobie
myobie / example-throws-in-callback-that-works-in-playgrounds.swift
Created November 29, 2017 02:36
An example of swift async callbacks that either throw or return a result
import Foundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
// either throws an Error or returns a String result
typealias ThrowsCallback = () throws -> (String)
enum AsyncError: Error {
case kaboom
}