Skip to content

Instantly share code, notes, and snippets.

Jonny MacEachern jonnymaceachern

Block or report user

Report or block jonnymaceachern

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:6026c8c04497909b8196c3e031f026b4
### Keybase proof
I hereby claim:
* I am jonnymaceachern on github.
* I am jonnymaceachern (https://keybase.io/jonnymaceachern) on keybase.
* I have a public key whose fingerprint is 6A78 AA59 B2AD 89D9 C60D 0EB3 73C0 1EBB 9860 CAA3
To claim this, I am signing this object:
@jonnymaceachern
jonnymaceachern / batch-convert-mp4-webm.sh
Created Aug 28, 2019
Batch convert mp4 to webm using ffmpeg
View batch-convert-mp4-webm.sh
for i in *.mp4;
do name=`echo "$i" | cut -d'.' -f1`
echo "$name"
ffmpeg -i "$i" -acodec libvorbis -aq 5 -ac 2 -qmax 25 -threads 2 "${name}.webm"
done
@jonnymaceachern
jonnymaceachern / equalize.js
Last active Aug 15, 2019
Get elements that begin with a common class prefix, group them accordingly, and equalize their heights to their max height
View equalize.js
var cousins = [];
// Find all elements that begin with class and return just that matching class
$('[class^=equalize-').each(function(index, el, array) {
var group = $(el).attr('class').match(/\bequalize-[\S]*/);
if ( group.length ) {
cousins.push( group[0] );
}
});
@jonnymaceachern
jonnymaceachern / _show-bootstrap-breakpoints.scss
Last active Sep 6, 2019
Always display current breakpoint using Bootstrap 4's media breakpoint SCSS variables
View _show-bootstrap-breakpoints.scss
body {
&:after {
content: "< #{map-get($grid-breakpoints, sm)} (xs)";
position: fixed;
z-index: 99999;
padding: 2px 15px;
bottom: 0;
left: 0;
border-top-right-radius: 5px;
background: blue;
@jonnymaceachern
jonnymaceachern / external-links-in-new-tab.js
Created Jan 31, 2018
Add target="_blank" to external links
View external-links-in-new-tab.js
View posts.php
<?php
// Define custom query parameters
$custom_query_args = array( /* Parameters go here */ );
// Get current page and append to custom query parameters array
$custom_query_args['paged'] = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
// Instantiate custom query
$custom_query = new WP_Query( $custom_query_args );
View keybase.md

Keybase proof

I hereby claim:

  • I am jonnymaceachern on github.
  • I am jonnymaceachern (https://keybase.io/jonnymaceachern) on keybase.
  • I have a public key whose fingerprint is 092E 2E5F 5D35 1E0B A64B 8E62 EF04 4D24 1316 0AC0

To claim this, I am signing this object:

View theme.php
PC::debug( compact('atts', 'item', 'args') );
View _functions.scss
/**
* Get color based of $colors map
*/
@function color($color) {
@return map-get($colors, $color );
}
// Usage
.header {
You can’t perform that action at this time.