Skip to content

Instantly share code, notes, and snippets.

View mmcclimon's full-sized avatar

Michael McClimon mmcclimon

View GitHub Profile
@mmcclimon
mmcclimon / fold-headers.py
Created August 3, 2023 01:50
goofy program: fold-headers
#!/usr/bin/env python
import fileinput
import re
in_headers = True
header_start = re.compile(r"[-A-Za-z0-9]+:\s")
for line in fileinput.input():
if line.isspace():
in_headers = False
@mmcclimon
mmcclimon / git-slog.pl
Created July 5, 2023 01:03
goofy program: git log, but with sign-off lines
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
binmode STDOUT, ':encoding(UTF-8)';
open my $git, '-|', (
'git',
'log',
@mmcclimon
mmcclimon / wordle.mjs
Created August 5, 2022 02:17
a stupid couch wordle solver
import { open } from 'node:fs/promises';
import * as readline from 'node:readline/promises';
import { once } from 'node:events';
const WRONG = 0;
const MISPLACED = 1;
const CORRECT = 2;
const readWords = async function () {
const words = [];
Rolling Stone 500 Greatest Albums
[ ] 1. Marvin Gaye - What's Going On
[ ] 2. The Beach Boys - Pet Sounds
[ ] 3. Joni Mitchell - Blue
[ ] 4. Stevie Wonder - Songs in the Key of Life
[ ] 5. The Beatles - Abbey Road
[ ] 6. Nirvana - Nevermind (1991)
[ ] 7. Fleetwood Mac - Rumours
[ ] 8. Prince - Purple Rain
@mmcclimon
mmcclimon / vesta.txt
Created July 19, 2021 23:13
rik birthday vesta rotation
+----------------------+
|   ------             |
|  /      .            |
| I--()()--I   HAPPY   |
| I        I   BIRTHDAY|
| I  .  ,  I   RJBS    |
|  .  --  .            |
+----------------------+
+----------------------+
@mmcclimon
mmcclimon / robcol.pl
Last active June 22, 2021 00:50
robcol.pl
#!/usr/bin/env perl
use v5.26;
use warnings;
use Getopt::Long::Descriptive;
my ($opt, $usage) = describe_options(
'%c %o',
[ 'padding|p=i', 'spaces to separate columns by', { default => 2} ],
[ 't', 'this does nothing but helps your muscle memory' ],
[ 'help|h', 'print usage and exit', { shortcircuit => 1 } ],
commit 1ab441c2e580e7498617dedcff90df674743e3e5
Date: 2017-04-11 15:13:15 -0400
fix handling of non-ASCII whitespace in newline munging
Cyrus will only accept mail with CRLF line endings, as is right and
proper for a network service. Meanwhile, postfix sends mail to pipe(8)
transports with LF only, as is right and proper for a unix text pipe.
To translate that, we start by converting incoming newlines from
@mmcclimon
mmcclimon / mto.vim
Created March 2, 2020 00:55
MTO nonsense
let b:mto_open_tag = "<?php "
let b:mto_close_tag = "?>"
" Stolen from https://stackoverflow.com/a/1534347/1824895
function! s:get_visual_selection()
normal! gv"zy
return @z
endfunction
function! s:_one_arg(prompt, php_func_name, add_dollar=0)
@mmcclimon
mmcclimon / blank-cv.tex
Created October 3, 2015 20:12
CV template
\documentclass[12pt]{article}
\usepackage[margin=1in,headheight=.5in]{geometry}
\usepackage{fontspec}
\usepackage{titlesec}
\usepackage{array}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchUppercase,%
SmallCapsFeatures={LetterSpace=5.0,Letters = SmallCaps}}
\setmainfont[Numbers={OldStyle}]{Minion Pro}
\titleformat*{\section}{\large}