Skip to content

Instantly share code, notes, and snippets.

View mtinsley's full-sized avatar

Mathew Tinsley mtinsley

  • Orange County, CA
View GitHub Profile
@hestenet
hestenet / column-toggle-and-size-for-jira-rapid-boards.js
Last active August 20, 2021 17:59
A javascript hack for JIRA that allows resizing of RapidBoard columns and toggling their display on/off - just add to your Announcement Banner
<script type="text/javascript">
/////////////////////
//
// DO NOT DELETE ME!
// Please take care when editing the announcement banner - it contains custom Javascript/CSS to improve Jira's UI.
//
/////////////////////
/////////////////////
// Inspired by
@OllieJones
OllieJones / fullquery
Last active September 25, 2023 14:09
Fast nearest-location finder for SQL (MySQL, PostgreSQL, SQL Server)
SELECT zip, primary_city,
latitude, longitude, distance
FROM (
SELECT z.zip,
z.primary_city,
z.latitude, z.longitude,
p.radius,
p.distance_unit
* DEGREES(ACOS(LEAST(1.0, COS(RADIANS(p.latpoint))
* COS(RADIANS(z.latitude))
@ninnypants
ninnypants / remove-empty-p.php
Last active January 3, 2023 01:11
Remove empty p tags from WordPress posts
<?php
add_filter( 'the_content', 'remove_empty_p', 20, 1 );
function remove_empty_p( $content ){
// clean up p tags around block elements
$content = preg_replace( array(
'#<p>\s*<(div|aside|section|article|header|footer)#',
'#</(div|aside|section|article|header|footer)>\s*</p>#',
'#</(div|aside|section|article|header|footer)>\s*<br ?/?>#',
'#<(div|aside|section|article|header|footer)(.*?)>\s*</p>#',
'#<p>\s*</(div|aside|section|article|header|footer)#',