Skip to content

Instantly share code, notes, and snippets.

View roberthein's full-sized avatar
👋

Robert-Hein Hooijmans roberthein

👋
View GitHub Profile
@realvjy
realvjy / ChoasLinesShader.metal
Last active October 23, 2024 20:57
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);
//
// Diagrams.swift
// DiagramsSample
//
// Created by Chris Eidhof on 16.12.19.
// Copyright © 2019 objc.io. All rights reserved.
//
import SwiftUI
@chriseidhof
chriseidhof / sample.swift
Last active September 16, 2024 06:02
View Inspection
import SwiftUI
struct SizeKey: PreferenceKey {
static func reduce(value: inout CGSize?, nextValue: () -> CGSize?) {
value = value ?? nextValue()
}
}
struct ContentView: View {
@State var width: CGFloat? = nil
var body: some View {
@morganwilde
morganwilde / gist:5574439
Created May 14, 2013 08:12
CATransform3D matrix with values explained
CATransform3D transformation = CATransform3DIdentity;
// x line
transformation.m11 = 1; // 20% less wide wall
transformation.m12 = 0; //-1 / 10.0; // skews left up, right down if >0
transformation.m13 = 0; // extends sideways for a short time
transformation.m14 = 0;// // 1 / 5000 = left side towards viewer, right side away from viewer
// y line
transformation.m21 = 0; //-1 / 2.0; // skews bottom left, top right if <0
transformation.m22 = 1; // .8 - 20% less tall
transformation.m23 = 0; // extends upward for a short time