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
antoineMoPa / ai-code-review-checklist.md
Last active April 14, 2026 11:18
Code review prompt to de-sloppify code

Can you do a first pass of cleanups? Pay attention to:

  • Leaked keys

  • Indirectly leaked keys

  • Overly defensive programming and hiding failures instead of letting errors bubble up, also while adding too much code.

    • This is perhaps the most common and annoying. The AI wants to build trust by making code that can’t fail, but that ultimately is just gaslighting us into thinking it works / is robust. It’s delaying finding issues and making unmaintainable code.

    Here is an example:

Inlining SVG styles easily with svgo

First install svgo

npm install -g svgo
@antoineMoPa
antoineMoPa / search
Created April 29, 2025 15:31
Put this search script file in some dir that's in your PATH
@antoineMoPa
antoineMoPa / minimal_rust_candle_xor_neural_network_code.md
Last active January 22, 2025 14:41
Minimal example neural net using huggingface's rust neural net library: candle

Rust neural networks with candle

This is a complete example of using candle to train a simple neural network on a XOR dataset.

Why build this?

Hopefully, this helps some folks trying candle for the first time!

Breaking it down into baby steps

@antoineMoPa
antoineMoPa / wgsl.md
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, camera_right.xyz), dot(p, camera_up.xyz));
@antoineMoPa
antoineMoPa / .gitconfig
Created October 25, 2023 20:32
Recent git branches alias
# Add this to your .gitconfig and use `git recent-branches`
[alias]
recent-branches = branch -v --sort=-committerdate
@antoineMoPa
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
antoineMoPa / Reproducing Flaky Tests.md
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
antoineMoPa / index.html
Created June 18, 2023 13:11
index.html (cities)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body{
padding: 0;
margin: 0;
}
</style>
ARCH=$(uname -m)
echo "Detected OS: GNU/Linux"

if [[ "$ARCH" == "x86_64" ]]; then
    echo "Detected 64 bit intel"
    BINARIES_URL="https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2023-04-19-14-14/ffmpeg-n5.1.3-6-g1e413487bf-linux64-gpl-shared-5.1.tar.xz -O ffmpeg.tar.xz"
elif [[ "$ARCH" == "aarch64" ]]; then
    # ARM linux setup
 echo "Detected ARM"