Skip to content

Instantly share code, notes, and snippets.

View mauteri's full-sized avatar

Mike Auteri mauteri

View GitHub Profile
@mauteri
mauteri / github-approved-prs.sh
Created September 4, 2025 19:31
List approved PRs by reviewer in a GitHub org (CSV export).
#!/bin/bash
set -euo pipefail
# GitHub API script to find PRs approved by a specific reviewer
# Usage: bash github_approved_prs.sh REVIEWER [DAYS_AGO]
#
# Requirements:
# - jq (JSON parser)
# - curl
#
@mauteri
mauteri / keybase.md
Last active July 29, 2025 20:22
keybase.md

Keybase proof

I hereby claim:

  • I am mauteri on github.
  • I am mauteri (https://keybase.io/mauteri) on keybase.
  • I have a public key ASAFa2IBeyL0ZApMUhqCs9KWNI45yEPOnN7IR9-hwjji5wo

To claim this, I am signing this object:

@mauteri
mauteri / gatherpress-duration-options.php
Created April 24, 2025 01:11
GatherPress Duration Options (Test)
<?php
/**
* Plugin Name: GatherPress Duration Options
* Description: Adds custom duration options to the GatherPress plugin using the durationOptions filter.
* Version: 1.0
* Author: Mike Auteri
* License: GPL2+
*/
defined( 'ABSPATH' ) || exit;
import { commaSeparatedStringToArray } from '../index';
describe('commaSeparatedStringToArray', () => {
test('Returns array from comma separated string', () => {
expect(commaSeparatedStringToArray('my,unit,test')).toEqual(['my','unit','test']);
});
test('Throws when non-string passed', () => {
expect(() => {
commaSeparatedStringToArray(5);
import { isPositiveNumber } from '../index';
describe('isPositiveNumber', () => {
test('Returns true if number is positive', () => {
expect(isPositiveNumber(5)).toBe(true);
});
test('Returns false if number is negative', () => {
expect(isPositiveNumber(-5)).toBe(false);
});
@mauteri
mauteri / gist:55f87b8ae004b6abb77822b37d4fd625
Created July 16, 2021 21:54
addListItem DOM Manipulation Jest Test
import {addListItem} from '../index';
describe('addListItem', () => {
beforeAll(() => {
document.body.innerHTML = '<ul id="unittest"></ul>';
const $el = document.getElementById('unittest')
addListItem($el, 'First');
addListItem($el, 'Second');
addListItem($el, 'Third');
public function closest_image_size( $width, $height, $photos ) {
foreach( $photos as $photo ) {
if( $width <= $photo['width'] && $height <= $photo['height'] ) {
$w = $photo['width'] - $width;
$h = $photo['height'] - $height;
if( !isset($source) ) {
$sum = $w + $h;
$source = $photo['source'];
} else if( $sum > ( $w + $h ) ) {
$sum = $w + $h;