Skip to content

Instantly share code, notes, and snippets.

View joeyates's full-sized avatar

Joe Yates joeyates

View GitHub Profile
# Upload an item with an image field
export DATO_CMS_API=https://site-api.datocms.com
export DATO_CMS_API_TOKEN={{your read-write API token}}
# Get info about your Models (item-types):
curl \
-H "Authorization: Api-Key $DATO_CMS_API_TOKEN" \
-H "Accept: application/json" \
@joeyates
joeyates / certificate-expiry
Last active January 25, 2021 15:21
Get the expiry date for an online TLS/SSL certificate
#!/usr/bin/env bash
hostname=$1
online-certificate $hostname | \
openssl x509 -inform pem -noout -enddate
@joeyates
joeyates / rename_media.rb
Last active February 18, 2018 16:06
Classify Photos and Movies Downloaded from Android Phone into nested directories by Year, Month and Day
#!/usr/bin/env ruby
require "fileutils"
require "rake"
ROOT = File.expand_path(ARGV[0] || ".", Dir.pwd)
ANDROID_MATCH = /
\/ # The whole file name
(IMG|VID) # starts with an image or film indicator.
_ # An underscore is followed by
@joeyates
joeyates / chewy-date-range-query.rb
Created April 10, 2018 09:36
Use Chewy to extract a date range
bars =
FooIndex::Bar.all.
query(range: {start_date: {lt: "2018-03-31"}}).
query(range: {end_date: {gt: "2018-03-31"}}).
load.to_a
@joeyates
joeyates / writable.md
Created October 7, 2018 21:04
Gist Writable URL
  • get the Repo's hash from the Gist URL
  • the writable URL is:
git@gist.github.com:<hash>
@joeyates
joeyates / coverage.json
Last active January 6, 2026 18:10
JSON File Generated by imap-backup's GitHub Actions Pipeline for Use with shields.io
{"label":"Coverage","message":"100%","schemaVersion":1,"color":"brightgreen"}
@joeyates
joeyates / coverage.json
Last active November 1, 2023 17:12
JSON File Generated by solar_edge's GitHub Actions Pipeline for Use with shields.io
{"schemaVersion":1,"label":"Coverage","message":"94%","color":"brightgreen"}
@joeyates
joeyates / coverage.json
Last active January 20, 2024 17:54
JSON File Generated by joeyates/mork's GitHub Actions Pipeline for Use with shields.io
{"schemaVersion":1,"label":"Coverage","message":"92%","color":"brightgreen"}