Skip to content

Instantly share code, notes, and snippets.

@slimbuck
slimbuck / webgpu_metal_capture.txt
Created May 13, 2024 08:47
Capturing WebGPU metal trace on MacOS
1) Clone and build WebKit
git clone https://github.com/WebKit/WebKit.git WebKit
cd WebKit
Tools/Scripts/build-webkit -cmakeargs="-DENABLE_WEBGPU_BY_DEFAULT=1" --debug
2) Run your app
__XPC_METAL_CAPTURE_ENABLED=1 Tools/Scripts/run-minibrowser --debug --url http://localhost:5000/index.html#/loaders/gsplat
@munrocket
munrocket / wgsl_3d_sdf.md
Last active September 15, 2024 15:11
WGSL 3D SDF Primitives

WGSL 3D SDF Primitives

Revision: 06.08.2023, https://compute.toys/view/407

Sphere - exact

fn sdSphere(p: vec3f, r: f32) -> f32 {
  return length(p) - r;
}
@munrocket
munrocket / wgsl_noise.md
Last active September 3, 2024 14:53
WGSL Noise Algorithms

WGSL Noise Algorithms

Good and fast integer hash

// https://www.pcg-random.org/
fn pcg(n: u32) -> u32 {
    var h = n * 747796405u + 2891336453u;
    h = ((h >> ((h >> 28u) + 4u)) ^ h) * 277803737u;
    return (h >> 22u) ^ h;
}
@jordansinger
jordansinger / macOS.swift
Last active September 5, 2024 01:58
macOS SwiftUI Playgrounds code
import SwiftUI
import PlaygroundSupport
struct Desktop: View {
var body: some View {
ZStack {
// Image(uiImage: #imageLiteral(resourceName: "IMG_6281.JPG"))
Color(UIColor.systemBlue)
macOS()
}
#!/bin/sh
# From http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
# Usage:
# ./makegif.sh inputframes output.gif
# where inputframes is a directory containing .png frames
# Change size here
filters="scale=640:-1:flags=lanczos"
// MIT licensed.
function fabsf (arg) {
return arg >= 0 ? arg : -arg
}
function planeBoxOverlap (normal, vert, maxbox) {
var q
var vmin = []
var vmax = []
var v
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active September 14, 2024 16:30
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@staltz
staltz / introrx.md
Last active September 16, 2024 07:18
The introduction to Reactive Programming you've been missing
@adamwiggins
adamwiggins / adams-heroku-values.md
Last active September 5, 2024 20:18
My Heroku values

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style