Skip to content

Instantly share code, notes, and snippets.

View sclausen's full-sized avatar

Sebastian Clausen sclausen

  • appmotion GmbH
  • Rosendahl, Germany
View GitHub Profile
@munrocket
munrocket / wgsl_2d_sdf.md
Last active June 4, 2024 09:46
WGSL 2D SDF Primitives

WGSL 2D SDF Primitives

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

Circle - exact

fn sdCircle(p: vec2f, r: f32) -> f32 {
  return length(p) - r;
}
@munrocket
munrocket / wgsl_3d_sdf.md
Last active June 28, 2024 17:29
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;
}
@abhinavlal
abhinavlal / reset_autoincrement.sh
Created January 19, 2013 08:45
Reset auto increment of all tables in a mysql database
mysql -Nsr -e "SELECT t.table_name FROM INFORMATION_SCHEMA.TABLES t WHERE t.table_schema = 'DB_NAME'" | xargs -I {} mysql DB_NAME -e "ALTER TABLE {} AUTO_INCREMENT = 1;"