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:
| #!/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 | |
| # |
I hereby claim:
To claim this, I am signing this object:
| <?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); | |
| }); |
| 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; |