Skip to content

Instantly share code, notes, and snippets.

View antoineMoPa's full-sized avatar

Antoine M-P antoineMoPa

  • Sherbrooke, Québec, Canada
View GitHub Profile
antoineMoPa /
Last active January 6, 2024 18:53
WGSL vector math utils

WGSL SDF/vector math utils

Please report any issues

Vector Projection

fn position_in_camera_plane(p: vec3<f32>) -> vec2<f32> {
 return vec2(dot(p,, dot(p,;
antoineMoPa / .gitconfig
Created October 25, 2023 20:32
Recent git branches alias
# Add this to your .gitconfig and use `git recent-branches`
recent-branches = branch -v --sort=-committerdate
antoineMoPa / debug-on-property-set.js
Last active October 15, 2023 16:56
Javascript debug on property set (debug on property changer)
const object_to_watch = obj; // Change to the object you are inspecting
const property_to_watch = 'example'; // Change to the property name in the object you are inspecting (here obj.example)
// Store the original value
object_to_watch.__storedValue = object_to_watch[property_to_watch];
Object.defineProperty(object_to_watch, property_to_watch, {
get() {
return this.__storedValue;
antoineMoPa / Reproducing Flaky
Last active August 10, 2023 16:50
Reproducing Flaky Tests

Reproducing Flaky Tests Tips and Tricks

Use a slower machine

Some time-sensitive test may be easier to reproduce on slower machines.

-resource_class: large
+resource_class: medium
antoineMoPa / index.html
Created June 18, 2023 13:11
index.html (cities)
<!DOCTYPE html>
<meta charset="utf-8">
padding: 0;
margin: 0;
ARCH=$(uname -m)
echo "Detected OS: GNU/Linux"

if [[ "$ARCH" == "x86_64" ]]; then
    echo "Detected 64 bit intel"
    BINARIES_URL=" -O ffmpeg.tar.xz"
elif [[ "$ARCH" == "aarch64" ]]; then
    # ARM linux setup
 echo "Detected ARM"
antoineMoPa / gist:3ec1742488de72dedc9940b68d4927e8
Created April 4, 2023 20:31
Beamcoder filter info (output of `beamcoder.filters()`)
abench: {
name: 'abench',
description: 'Benchmark part of a filtergraph.',
inputs: [ [Object] ],
outputs: [ [Object] ],
priv_class: { type: 'Class', class_name: 'abench', options: [Object] },
flags: {
antoineMoPa / Makefile
Last active October 22, 2022 16:07 — forked from miguelmota/Makefile
Go (golang) WebAssembly (WASM) hello world example
serve: compile
go run server.go
compile: main.go
GOARCH=wasm GOOS=js go build -o test.wasm main.go