Skip to content

Instantly share code, notes, and snippets.

View ElPresidentePoole's full-sized avatar

El Presidente ElPresidentePoole

View GitHub Profile
@ElPresidentePoole
ElPresidentePoole / get_vector_towards_position.c
Created June 13, 2023 19:00
Get Vector Towards Position
#include <math.h> // include this at the top of your .c file
Vector2 get_vector_towards_position(Vector2 from, Vector2 to) {
int dx = from.x - to.x;
int dy = from.y - to.y;
double angle_between_points = atan2(dy, dx);
return (Vector2){-cos(angle_between_points), -sin(angle_between_points)};
}
@ElPresidentePoole
ElPresidentePoole / check-for-updates.sh
Created May 30, 2023 06:38
Check for Updates on Void Linux (xbps)
#!/usr/bin/env sh
UPDATE_COUNT=$(xbps-install -SMnu | wc -l)
notify-send "$UPDATE_COUNT updates are available for install."