Skip to content

Instantly share code, notes, and snippets.


Greg Boone gboone

View GitHub Profile
#! /bin/zsh
# Very much low-fi, low-tech shortcut to check a domain name passed via stdin and return details about the certificate.
# If `ca` is passed, the "CA Issuers" string is grepped from the output.
echo $domain
if [[ $2 == "ca" ]]; then
echo | openssl s_client -showcerts -servername $domain -connect $domain:443 2>/dev/null | openssl x509 -inform pem -noout -text | grep "CA Issuers";
echo | openssl s_client -showcerts -servername $domain -connect $domain:443 2>/dev/null | openssl x509 -inform pem -noout -text;
gboone /
Last active Jun 25, 2018
How to find intermediate images in a list of files
gboone / wp_metadata_filter.rb
Created Sep 2, 2017
A jekyll filter to sort out and return only the wp:post_meta keys and values
View wp_metadata_filter.rb
module Jekyll
module WPmetadata
def wpmeta(input)
standard_post = [
gboone / feed-wordpress.xml
Last active Feb 21, 2019
A simple jekyll template to generate WordPress eXtended RSS (WRX) feeds suitable for importing into a WordPress site
View feed-wordpress.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your site. -->
<!-- To import this information into a WordPress site follow these steps: -->
<!-- 1. Log in to that site as an administrator. -->
gboone / commit-msg
Last active May 11, 2017
Copy Federalist preview URL on commit
View commit-msg
# A commit-msg hook to copy the federalist preview url to your clipboard after you commit.
# Note: The URL will not work until the preview site has actually generated, that doesn't happen until you `push`
NAME=$(git branch | grep '*' | sed 's/* //')
echo "Your federalist preview will be at$NAME/"
echo "$NAME/" | pbcopy
echo "This url has been copied to your clipboard."
gboone /
Last active Jan 11, 2017
Thanksgiving OOO

Hey there, I'm out of office for the Thanksgiving holiday. While you wait for me to get back to you, check out these ten awesome initiatives from my colleagues across the federal government:

  1. The General Services Administration's Fine Arts program has a trove of public art. Search the database and find some art near you!
  2. Speaking of art, the Bureau of Reclamation commissioned dozens of works of art in the 1960s. Check out the works they commissioned on their website.
  3. The National Ice Core Lab in Lakewood, CO contains samples of ice from deep in the earth's surface. It's pretty much the closest thing we have to time travel.
  4. Help your relatives stay safe if their identity is stolen on the Federal Trade Commission's [](
View strip-doc-to-frontmatter.rb
# Strips the body out of a document. Quick and dirty, assumes ARGV is a real directory with markdown or YAML files in it.
# I hard coded the directory and am not really a rubyist so there's a chance I screwed up this ARGV thing.
#!/usr/bin/env ruby
require 'yaml'
files = Dir.glob("#{ARGV[0]}/*")
for file in files
yaml = YAML.load(, 'w') { |f|
f.write(yaml.to_yaml + "---")
gboone / til.rb
Created Jan 20, 2016
Today I Learned about ruby logic
View til.rb
# this:
if expected['value']
variable = expected['value']
variable = "default"
# is the same as this:
unless variable = expected['value']
variable = "default"
gboone / midpoint
Created Nov 28, 2015
How to find a geographic midpoint in js
View midpoint
function setLatLng(dataset) {
var lat =
var lng = dataset.lng
return new L.LatLng(lat, lng)
function latLngRadians(dataset) {
return, function(item) {
var latRad =*(Math.PI/180)
var lngRad = item.lng*(Math.PI/180)
gboone / gist:4f4dee1290278b483e24
Created Jun 8, 2015
Turn "authors" attached to blog posts into a _data file
View gist:4f4dee1290278b483e24
#! /usr/bin/ruby
require 'jekyll'
config = Jekyll.configuration
source = config['source']
data_source = File.join(source, config['data_source'])
posts = File.join(source, '_posts')
authors = []
if ARGV[0].nil?
puts "No value passed for filename, assuming 'author.'"
file_name = 'author'
You can’t perform that action at this time.