Skip to content

Instantly share code, notes, and snippets.

View jonnymaceachern's full-sized avatar

Jonny jonnymaceachern

  • Developer @ Media Mechanics
  • Halifax, NS
  • 19:19 (UTC -03:00)
View GitHub Profile
@jonnymaceachern
jonnymaceachern / _show-bootstrap-breakpoints.scss
Last active April 8, 2023 11:17
Always display current breakpoint using Bootstrap 4's media breakpoint SCSS variables
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 January 31, 2018 15:27
Add target="_blank" to external links
=SUM(INDIRECT("B1:"&ADDRESS(ROW()-1,COLUMN(),4)))
<?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 );

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:

PC::debug( compact('atts', 'item', 'args') );
/**
* Get color based of $colors map
*/
@function color($color) {
@return map-get($colors, $color );
}
// Usage
.header {
/**
* 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 July 17, 2017 19:10
Git find pre-existing file that was deleted and bring it back
git rev-list -n 1 HEAD -- <file_path>
git checkout <deleting_commit>^ -- <file_path>
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();