Skip to content

Instantly share code, notes, and snippets.

@pocke pocke/this-year-repos.rb
Last active Dec 31, 2019

What would you like to do?
Print repositories created this year
require 'bundler/inline'
gemfile do
source ''
gem 'octokit'
name = ARGV[0] || `git config --get github.user`.chomp
year = ARGV[1] ||
raise "ruby this-year-repos.rb USERNAME [YEAR]" if !name || name.empty?
c ={ |c|
c.per_page = 100
c.auto_paginate = true
puts c.search_repos("user:#{name} created:#{year}-01-01..#{year}-12-31").items.sort_by(&:created_at).map{|r|"{r.full_name}"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.