Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonny MacEachern jonnymaceachern

View GitHub Profile
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 {
View _mixins.scss
/**
* Trim beginning and end of group
*/
@mixin trim-padding {
&:first-of-type {
padding-left: 0;
}
&:last-of-type {
padding-right: 0;
@jonnymaceachern
jonnymaceachern / gist:e248ea3891686e6048889c07cbf95a21
Last active Jul 17, 2017
Git find pre-existing file that was deleted and bring it back
View gist:e248ea3891686e6048889c07cbf95a21
git rev-list -n 1 HEAD -- <file_path>
git checkout <deleting_commit>^ -- <file_path>
View pocketcasts.mark-as-unwatched.js
/**
* @description Pocket Casts bookmarklet to mark all podcasts as unwatched
*/
var current_show = $('#podcast_show');
if ( current_show.length ) {
// Expand more
$('.show_more').trigger('click');
View unsub-defaults.js
javascript:function removeSubscriptions() { var subs = $('.subscription-box .remove.active'); subs.each( function(i, v) { setTimeout( function() { $(this).trigger('click'); console.log('Unsubscribing... (' + (i+1) + '/' + (subs.length + 1) +')'); }.bind(this), i * 500); }); } removeSubscriptions();
View gist:a4607564401243da7360b9c1c2351c75
assoc .ext="Some Extension Name"
ftype "Some Extension Name"="c:/sublime_text.exe"
You can’t perform that action at this time.