Skip to content

Instantly share code, notes, and snippets.

View pdxmph's full-sized avatar

Mike Hall pdxmph

View GitHub Profile
pdxmph / makeapp.rb
Created November 19, 2023 18:48
Wrapper to make nativifier apps and create the corresponding .desktop files
View makeapp.rb
#!/usr/bin/env ruby
# - `makeapp.rb --help` for help on the options
require 'optparse'
# Where do we want to put things?
app_dir = "~/Applications"
custom_dir = "/home/mph/.local/share/applications/"
pdxmph / update_contact.applescript
Last active April 27, 2023 18:11
Half-working contact update
View update_contact.applescript
-- provided there's a custom date field in a contact record, this will prepend a datestamped note and update "last contacted" to today.
set theDate to do shell script "date +%Y-%m-%d"
tell application "Contacts"
set selectedPeople to selection
repeat with thePerson in selectedPeople
set customDates to custom dates of thePerson
repeat with aCustomDate in customDates
if label of aCustomDate is "last contacted" then
set value of aCustomDate to current date
pdxmph / trains.rb
Last active April 15, 2023 06:35
ChatGPT-generated script to find the arrival time of a train at a given station in Portland, OR
View trains.rb
#!/usr/bin/env ruby
require 'net/http'
require 'json'
require 'time'
# Replace with your TriMet API key
API_KEY = '73E10D534D59A179A687B98EDEE'
# Replace with the TriMet stop ID for the stop you're interested in
STOP_ID = '13136'
pdxmph / catppuccin-simple-custom.css
Created January 22, 2023 04:16
Sample custom CSS to override simplecss with Catppuccin palette
View catppuccin-simple-custom.css
@import url('');
@import url('');
@import url('');
h1, h2, h3, h4, h5, h6 {
font-family: 'Neuton', serif;
:root {
pdxmph /
Created January 12, 2023 18:16
Sample config for obsidian43-text-transporter plugin
pdxmph / save_chrome_url.rb
Created November 6, 2011 03:47
Add a URL from Chrome to Safari's reading list
View save_chrome_url.rb
#!/usr/bin/env ruby -wKU
require "rubygems"
require "appscript"
include Appscript
chrome = app("Google Chrome")
safari = app("Safari")
chrome_tab =[1].active_tab

Keybase proof

I hereby claim:

  • I am pdxmph on github.
  • I am pdxmph ( on keybase.
  • I have a public key ASAx8GzdJNTg9VBxmxJs5L4A8HPrAN1-6OIiHw2Zy0uGNwo

To claim this, I am signing this object:

pdxmph / make_data.rb
Last active May 17, 2022 01:58
Populate Jekyll data directories with the jpegs found in _galleries/foo.
View make_data.rb
#!/usr/bin/env ruby
require 'yaml'
require 'mini_exiftool'
# Run this in the root of your jekyll install.
gallery_name = ARGV[0]
target_dir = "_galleries/#{gallery_name}"
data_file = "_data/galleries/#{gallery_name}.yml"
pdxmph /
Last active May 16, 2022 19:27
Using Jekyll data to provide descriptions to a cheesy-gallery gallery
pdxmph /
Last active April 19, 2022 04:15
Simple Markdown RFC template



**Created: **

**Deadline/Timeframe: **


**Driver: **