Skip to content

Instantly share code, notes, and snippets.

View cyrilzakka's full-sized avatar
💭
coding...

Cyril Zakka, MD cyrilzakka

💭
coding...
View GitHub Profile
@cyrilzakka
cyrilzakka / ChoasLinesShader.metal
Created October 23, 2024 20:57 — forked from realvjy/ChoasLinesShader.metal
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);
@cyrilzakka
cyrilzakka / KeyboardAnchoredContainer.swift
Created August 29, 2024 00:27 — forked from sammcode/KeyboardAnchoredContainer.swift
A wrapper view with an input that sticks to the top of the keyboard during interactive dismissal.
import SwiftUI
import UIKit
struct TextInputView: View {
@State private var textFieldText = ""
var body: some View {
TextField("Type here", text: $textFieldText)
.textFieldStyle(RoundedBorderTextFieldStyle())
.padding()
@cyrilzakka
cyrilzakka / ContentView.swift
Created September 25, 2023 20:05 — forked from alexwidua/ContentView.swift
SwiftUI Grid Animation
import SwiftUI
// 1. Use looped H/VStacks to create a grid
// 2. Conditionally increase spacing to grow/shrink the grid
// 3. Calculate the distance of each dot to the center and use the value to stagger the animation
//4. Add random delay on top of the staggered delay value
struct ContentView: View {
// const & state