Skip to content

Instantly share code, notes, and snippets.

@ajesler
ajesler / invoice.rb
Last active July 5, 2024 07:28
PDF Invoice generation script
#!/usr/bin/env ruby
# Usage:
# Save this to a file invoice.rb, and set the values from L#185 on to your needs.
# Then run
# $ ruby invoice.rb
require 'bundler/inline'
require "date"
@ajesler
ajesler / group_before_and_after_shots.rb
Last active July 5, 2024 08:09
Takes a set of photos and gpx tracks, and sorts them into before and after shots of common locations
# A quick and dirty script to match a bunch of before and after photos of locations. The location of each
# photo is matched by reading timestamps out of a GPX file and finding the closest point in
# the track (time wise) to the time the photo was taken.
# It then groups the photos based on a distance in meters threshold (LocalityGrouper distance parameter).
# The more accurate your GPS and the more frequent your point entries in the GPX track, the
# better this will work.
#
# This script assumes your photos have different dates for the before and after. If this isn't
# the case, you'll need to change the logic used for calculating grouped_photos
#