Skip to content

Instantly share code, notes, and snippets.

View brianmaierjr's full-sized avatar
🙃

Brian Maier Jr. brianmaierjr

🙃
View GitHub Profile
@brianmaierjr
brianmaierjr / logFocused.js
Created March 23, 2021 19:50
Console Log Focused Item
document.addEventListener('focus', function() {
console.log('focused: ', document.activeElement)
}, true);
@brianmaierjr
brianmaierjr / .htaccess
Created March 28, 2019 14:28
Security Headers
# Strict-Transport-Security
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
# X-Content-Type-Options
add_header X-Content-Type-Options "nosniff";
# X-XSS Protection
add_header X-XSS-Protection "1; mode=block";
# X-Frame-Options
@brianmaierjr
brianmaierjr / acf-relationship-to-accordion.php
Created May 4, 2018 15:39
ACF Relationship field array to accordion
<?php
// create an empty array
$home_faqs = array();
// get list of posts
$home_faqs_posts = get_field('relationship_field_name');
if( $home_faqs_posts ) {
foreach( $home_faqs_posts as $post) {
@brianmaierjr
brianmaierjr / mixitup-filter.js
Last active November 19, 2023 00:54
Filter MixItUp on load from hash in URL
// Setup MixItUp for card filtering
var mixer = mixitup('.program-card-container');
if ($('.program-card-container')) {
var container = $('.program-card-container')
var mixer = mixitup(container, {
callbacks: {
onMixStart: function(state, futureState) {
},
onMixEnd: function() {
@brianmaierjr
brianmaierjr / responsive-acf.php
Created September 18, 2017 15:14
Responsive Images with ACF
<?php
$image = get_field('banner_bg_image');
$medium = $image['sizes'][ 'medium' ];
$large = $image['sizes'][ 'large' ];
$full = $image[ 'url' ];
?>
<style>
@media screen and (min-width: 1024px) {
.banner--interior {
background-image: url(<?php echo $full; ?>);

Keybase proof

I hereby claim:

  • I am brianmaierjr on github.
  • I am brianmaierjr (https://keybase.io/brianmaierjr) on keybase.
  • I have a public key ASBSGDLc5uamD1qeMirMmdtAGYa_41kIURvcpgL2Pb1BWwo

To claim this, I am signing this object:

@brianmaierjr
brianmaierjr / OG Meta Basic
Last active August 29, 2015 14:21
Open Graph Meta Basics
<meta property="og:title" content="Facebook Open Graph META Tags"/>
<meta property="og:image" content="http://davidwalsh.name/wp-content/themes/klass/img/facebooklogo.png"/>
<meta property="og:site_name" content="David Walsh Blog"/>
<meta property="og:description" content="Facebook's Open Graph protocol allows for web developers to tur
@brianmaierjr
brianmaierjr / jQuery conflict fix
Last active August 29, 2015 14:06
WP fix for jQuery conflict
/*
Fix for jQuery conflict
*/
function enqueue_scripts() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', false, false, false );
wp_enqueue_script( 'jquery' );
}
add_action('wp_enqueue_scripts', 'enqueue_scripts');
@brianmaierjr
brianmaierjr / Smooth Anchor Link
Last active August 29, 2015 14:06
Smooth anchor link page scroll