Skip to content

Instantly share code, notes, and snippets.

View sherbondy's full-sized avatar

Ethan Sherbondy sherbondy

View GitHub Profile
@airspeedswift
airspeedswift / rbtree.swift
Created April 15, 2024 05:01
Red black tree in Swift 5.10
indirect enum Tree<Element: Comparable> {
enum Color { case R, B }
case empty
case node(Color, Tree<Element>, Element, Tree<Element>)
init() { self = .empty }
init(
@steventroughtonsmith
steventroughtonsmith / V3DViewContainer.swift
Created February 2, 2024 17:14
UIKit proxy for visionOS 3D transforms and effects
//
// V3DViewContainer.swift
// Vision3DUIKit
//
// Created by Steven Troughton-Smith on 02/02/2024.
//
import UIKit
import SwiftUI
@drewolbrich
drewolbrich / Entity+MoveAsync.swift
Last active February 26, 2025 07:18
An async version of RealityKit's Entity/move that returns when the animation completes
//
// Entity+MoveAsync.swift
//
// Created by Drew Olbrich on 1/15/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
@realvjy
realvjy / ChoasLinesShader.metal
Last active October 31, 2025 05:17
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@mxgrn
mxgrn / lv_modal_close_confirm.md
Last active June 15, 2024 14:18
LiveView modal close confirmation on dirty form

During the past days, this great article by Sam Pruden has been making the rounds around the gamedev community. While the article provides an in-depth analysis, its a bit easy to miss the point and exert the wrong conclusions from it. As such, and in many cases, users unfamiliar with Godot internals have used it points such as following:

  • Godot C# support is inefficient
  • Godot API and binding system is designed around GDScript
  • Godot is not production ready

In this brief article, I will shed a bit more light about how the Godot binding system works and some detail on the Godot

defmodule Super.RepoTest do
use Super.DataCase, async: true
require Logger
@skipped_schemas [UserService.User]
defp tenant_schemas do
{:ok, mods} = :application.get_key(:super, :modules)
Enum.map(mods, fn mod ->
func runModel(multiArr: MLMultiArray, img_w: Float, img_h:Float) {
let inputShape: [NSNumber] = [1 as NSNumber,
256 as NSNumber,
64 as NSNumber,
64 as NSNumber]
let input111 = try! MLMultiArray(shape: [1, 256, 64, 64], dataType: .float64)
// input111.withUnsafeMutableBytes { ptr, strides in
let data = NSMutableData(data: Data(count: 16777216))
@eldog
eldog / mediapipe_hands_world_space.py
Last active April 1, 2024 11:42
Google Mediapipe Hand Tracking to World Space using OpenCV solvePnP, rendered in OpenGL using PyGame
# MIT License
#
# Copyright (c) 2023 Foxdog Studios
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
defmodule MyApp.Books.Book do
use Ecto.Schema
import Ecto.Query, warn: false
import Ecto.Changeset
import MyApp.ChangesetHelpers
schema "books" do
field :name, :string
field :genres, {:array, :string}, default: []