Skip to content

Instantly share code, notes, and snippets.

@maxbeizer
Forked from martinwoodward/create-org-montage.sh
Created November 17, 2021 17:51
Show Gist options
  • Save maxbeizer/641fb118750df5f2ed754191ae73486e to your computer and use it in GitHub Desktop.
Save maxbeizer/641fb118750df5f2ed754191ae73486e to your computer and use it in GitHub Desktop.
Very quick ruby script to create a bash script that will create a montage of your org.
# Set OCTOKIT_ACCESS_TOKEN to authenticate with a PAT
# Something like OCTOKIT_ACCESS_TOKEN=<<TOKEN>> bundle exec ruby create-org-montage-script.rb
require "octokit"
Octokit.auto_paginate = true
# Replace <<ORG_NAME>> with your GitHub org
members = Octokit.org_members "<<ORG_NAME>>"
open('org-montage.sh', 'w') { |f|
# Yeah, I'm creating a bash script in Ruby - bite me
f << "#!/bin/bash\n"
members.each do |m|
f << "curl " + m[:avatar_url] + " --output images/" + m[:id].to_s + ".jpg\n"
end
# Uses 'montage' command from ImageMagick (apt install imagemagick)
# http://www.imagemagick.org/Usage/montage/
# You probably want to play with the number across here to get a 16:9 image.
# I'm creating an image that is 58 images wide made up of 48x48 pixel tiles.
f << "montage images/*.jpg -resize 48x48 -mode Concatenate -tile 58x ghmontage.jpg\n"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment