Skip to content

Instantly share code, notes, and snippets.

@craigeley
craigeley / completed_things3_tasks_to_dayone.rb
Created May 13, 2021
A script that finds tasks in Things 3 that were completed today and formats them as a Markdown list for Day One
View completed_things3_tasks_to_dayone.rb
#!/usr/bin/env ruby
# -*- coding: utf-8 -*- #specify UTF-8 (unicode) characters
require 'time'
tasktext = %x{ osascript <<APPLESCRIPT
set theDate to date string of ((current date))
tell application "Things3"
set output to ""
repeat with toDo in (to dos whose status is completed) of list "Logbook"
View srt_to_wav_region.js
#!/usr/local/bin/node
var sub = require('subtitle');
var fs = require('fs');
var WaveFile = require('wavefile').WaveFile;
// Load a wav file as a WaveFile object
let wav = new WaveFile('');
// Read from SRT file to get start, end, and region names
@craigeley
craigeley / otter_to_audition.rb
Last active Dec 31, 2019
A script to convert an SRT file from Otter.ai to cue markers in Adobe Audition
View otter_to_audition.rb
#!/usr/local/opt/ruby/bin/ruby
# Scipt to convert Otter.ai-generated SRT files into Adobe Audition Markers
require 'srt'
require 'csv'
CSV.open("audition_markers.csv", "wb", col_sep: "\t") do |csv|
csv << ["Name", "Start", "Duration", "Time Format", "Type", "Description"]
end
View Keybase.md

Keybase proof

I hereby claim:

  • I am craigeley on github.
  • I am craigeley (https://keybase.io/craigeley) on keybase.
  • I have a public key whose fingerprint is 66B0 914F 27AF 93C0 C719 18FF 8D8E 3F93 C7DD 54EB

To claim this, I am signing this object:

@craigeley
craigeley / add_instagram_to_contacts.scpt
Created May 23, 2019
This script takes the contents of your clipboard, allows you to search for a contact, and then adds an Instagram social media profile to that contact. Useful for use with the Vignette iOS app and the "Connections.json" file from the Instagram data dump.
View add_instagram_to_contacts.scpt
set input to the clipboard as text
--whole process is in a loop to allow for user to research for contact
repeat
--need to find contact in order to update their info
try
display dialog "Enter name or company of contact to Instagram to:" default answer ""
set thePerson to text returned of result
end try
@craigeley
craigeley / arc_to_dayone.rb
Created Jan 12, 2019
This app parses the Arc iOS app's GPX exports and sends location to the Day One journaling app. You must have the Day One command line interface installed and set the path to your GPX files on line 8.
View arc_to_dayone.rb
#!/usr/local/opt/ruby/bin/ruby
# Scipt to send Arc locations to Day One
require 'nokogiri'
require 'time'
require 'json'
filepath = "/Path/to/files/#{ARGV[0]}.gpx"
f = File.open(filepath)
@craigeley
craigeley / timeline_things_dayone.rb
Created Dec 30, 2017
Find completed Things tasks, cross reference them with Google Timeline, and send the output of each location to Day One.
View timeline_things_dayone.rb
#!/usr/local/bin/ruby
# Scipt for using Using Google Time to create summary records of Things in Day One
require 'time'
require 'date'
require 'json'
require 'yaml/store'
require 'nokogiri'
# To prevent encoding errors on OSX
@craigeley
craigeley / timeline_kml_to_geojson.rb
Created Dec 30, 2017
Parse a Google Timeline KML file and convert to geoJSON in order to visualize directly on GitHub.
View timeline_kml_to_geojson.rb
#!/usr/local/bin/ruby
# Scipt for parsing Google Timeline files to geoJSON
require 'time'
require 'json'
require 'nokogiri'
# To prevent encoding errors on OSX
if RUBY_VERSION =~ /2.*.*/
Encoding.default_external = Encoding::UTF_8
@craigeley
craigeley / asana_to_things.rb
Created Jun 18, 2017
Sync tasks assigned to you in an Asana workspace to an area in Things 3. Define variables for lines 20 and 21 in a "data.yml" file. Fill in your area name on line 22.
View asana_to_things.rb
#!/usr/bin/env ruby
# Syncing Tasks Assigned to you in Asana with Things 3
require 'json'
require 'yaml/store'
require 'time'
# Load storage file and variables
store = YAML::Store.new("data.yml")
mod = store.transaction { store[:mod_time] }
@craigeley
craigeley / toggl_reporter.rb
Last active Apr 6, 2018
When used with Hazel, a script that parses data from the Reporter app and starts a new time entry in Toggl.
View toggl_reporter.rb
#!/usr/bin/ruby
# Scipt for Using Reporter to start time entries in Toggl
require 'time'
require 'json'
# Prevent encoding errors on OSX
if RUBY_VERSION =~ /2.*.*/
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8