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
#
// References
// https://developers.google.com/apps-script/reference/spreadsheet/
// https://developers.google.com/apps-script/reference/xml-service
// https://github.com/international-orienteering-federation/datastandard-v3/blob/master/IOF.xsd
// https://github.com/international-orienteering-federation/datastandard-v3/blob/master/examples/CourseData_Individual_Step2.xml
// https://condes.net/onlinehelp/?HIDD_COPYOBJECTS.html
// See https://docs.google.com/document/d/1qSCO3uMm6tzxSS41zrhS6jWHufgTpipzf4SsAsMLLXQ for instructions on how to use this
// Convert a spreadsheet of control information into a IOF formatted XML file of controls that can be imported into Condes orienteering software.