Skip to content

Instantly share code, notes, and snippets.

View lauraporta's full-sized avatar

Laura Porta lauraporta

  • Sainsbury Wellcome Centre
  • London
View GitHub Profile
@lauraporta
lauraporta / mars
Created October 5, 2025 12:48
It's going to be mars
//https://iquilezles.org/articles/distfunctions/
float dot2( in vec2 v ) { return dot(v,v); }
float dot2( in vec3 v ) { return dot(v,v); }
float ndot( in vec2 a, in vec2 b ) { return a.x*b.x - a.y*b.y; }
float sphereSDF(vec3 p) {
return length(p) - 1.0;
}
// Estimate surface normal by sampling nearby points
@lauraporta
lauraporta / is_host_reachable.sh
Created January 14, 2025 11:45
Notify my when host is reachable [for mac os]
#!/bin/bash
HOST="your.host" # change it with your host address
echo "Checking connectivity to $HOST..."
while true; do
if ping -c 1 "$HOST" > /dev/null 2>&1; then
osascript -e "display notification \"$HOST is reachable again!\" with title \"Ping Notification\""
echo "$HOST is reachable again!"
@lauraporta
lauraporta / plots_to_video.py
Created January 14, 2025 11:41
From sequence of plots to a video
import imageio.v2 as imageio # Explicitly use imageio.v2 to avoid deprecation warnings
import os
from glob import glob
# Gather all image paths in the current folder
image_paths = glob("./*.png")
image_paths.sort(key=os.path.getctime)
# Define the output video file and frames per second
output_video = "output_movie.mp4"