Skip to content

Instantly share code, notes, and snippets.

@jjb
jjb / colors.md
Created June 27, 2024 19:17
Monokai Pro Colors
  • #2c292d $\textcolor{#2c292d}{\texttt{█ black}}$
  • #fdf9f3 $\textcolor{#fdf9f3}{\texttt{█ white}}$
  • #ff6188 $\textcolor{#ff6188}{\texttt{█ red}}$
  • #fc9867 $\textcolor{#fc9867}{\texttt{█ orange}}$
  • #ffd866 $\textcolor{#ffd866}{\texttt{█ yellow}}$
  • #a9dc76 $\textcolor{#a9dc76}{\texttt{█ green}}$
  • #78dce8 $\textcolor{#78dce8}{\texttt{█ blue}}$
  • #ab9df2 $\textcolor{#ab9df2}{\texttt{█ purple}}$

@jjb
jjb / code.rb
Last active December 16, 2024 19:35
Script to delete old git branches
# frozen_string_literal: true
require 'time'
# Get the list of branches with their last commit date
branches = `git for-each-ref --format '%(refname:short) %(committerdate)' refs/heads/`
months_ago = 12
threshold = Time.now - (months_ago * 30 * 24 * 60 * 60)
@jjb
jjb / code.rb
Last active March 25, 2025 13:36
delete old branches on github
#!/usr/bin/env ruby
require 'date'
require 'shellwords'
REMOTE = 'origin'
PROTECTED_BRANCHES = ['master']
YEARS_OLD = 2
def run_command(cmd)