Skip to content

Instantly share code, notes, and snippets.

View geoorgeous's full-sized avatar

georgeom geoorgeous

View GitHub Profile
/*
Original implementation written in JS: https://github.com/mapbox/tiny-sdf/blob/master/index.js
Paper on distance transform algorithm: http://cs.brown.edu/people/pfelzens/papers/dt-final.pdf
*/
#define INF 1e+20
void _edt1d(unsigned char * grid, unsigned int offset, unsigned int stride, unsigned int length, unsigned char * f, unsigned char * v, float * z)
{
unsigned int q, k, r;
@geoorgeous
geoorgeous / coding_standards_cpp.md
Last active February 18, 2020 10:49
An description of the coding standards I use for my C++ projects.

C++ Coding Standards

Naming Conventions

Variables

int thisIsALocalVairable

bool m_classMemberVariable

@geoorgeous
geoorgeous / certbot crontab job
Last active July 23, 2019 15:17
crontab file edit for certbot auto renewal twice a day (00:00 and 12:00). Also restarts specified web server service upon completing the certificate renewal. Currently using on *and only tested on* my RaspberryPi Raspbian Apache2 web server
# This line of text should be included in your crontab file which can be edited by
# running the following command:
# sudo crontab -e
# SERVER_SERVICE should be replaced with whatever service is running your web server,
# for example 'apache2' or 'nginx'
0 */12 * * * root certbot renew --post-hook "service SERVER_SERVICE restart"
@geoorgeous
geoorgeous / update_dynamic_ip
Last active July 23, 2019 15:53
A simple bash script that will update a host's IP address using the ZoneEdit DNS management service. Currently using on *and only tested on* my RaspberryPi Raspbian Apache2 web server
#!/bin/bash
# This file is intended to be used to update a host's IP address
# that uses the ZoneEdit DNS management service.
# This script uses dig to obtain the network's current public IP
# address which means it should be executed on a machine running
# on the same network as your server.
USERNAME=username
PASSWORD=password
@geoorgeous
geoorgeous / makefile
Created July 21, 2018 20:07
A makefile that works with projects being developed on Windows.
# www.georgemcdonagh.co.uk
# This is the makefile that I'm currently using for an OpenGL/C++ project.
# It's not the most elegant or full-proof makefile but it works for me!
# Currently it has only been tested on Windows10 using the g++ compiler through mingw-w64
# Project directory tree should look something like:
# Project Root/
# ├── bin/
// A rough implementation of the Half Edged
// Data Structure. A lot more could be added
// on top!
struct Vertex;
struct HalfEdge;
struct Face;
struct Vertex {
Edge* halfEdge;