Skip to content

Instantly share code, notes, and snippets.

View danbru1989's full-sized avatar

Dan Brubaker danbru1989

View GitHub Profile
@danbru1989
danbru1989 / bds-blur-images.js
Created December 20, 2023 21:25
BDS Blur Images
// ==UserScript==
// @name BDS Blur Images
// @namespace https://brubakerservices.org/
// @version 1.0
// @description Blur images on all websites and unblur gradually when mouse is hovered over an image.
// @author Dan Brubaker
// @match *://*/*
// @grant none
// ==/UserScript==
<?php
/**
* Updates Page.
*
* @package BrubakerDesignServices\FaithForRevivalTheme
* @since 1.0.0
* @author Dan Brubaker
* @link https://brubakerservices.org/
* @license GPL-2.0+
*/
@danbru1989
danbru1989 / functions.php
Last active March 7, 2018 19:50
Automatically Add Menu Item Titles to Menu Item CSS Classes
// Add descriptive CSS classes to menu items
add_filter('nav_menu_css_class', 'bds_nav_classes', 10, 2);
function bds_nav_classes( $classes, $item ) {
$item_class = strtolower( preg_replace("/[\s_]/", "-", $item->title) );
$classes[] = 'menu-item-' . $item_class;
return $classes;
}
@danbru1989
danbru1989 / home.php
Last active February 28, 2018 00:40
A custom Genesis blog page displaying three main sections. The 1st section is a featured post from category #1. The 2nd section shows some meeting info. The 3rd section displays posts from all categories except the post displayed in the 1st section.
<?php
// Add sections above the main blog loop
add_action( 'genesis_before_loop', 'bds_featured_post' );
add_action( 'genesis_before_loop', 'bds_meeting_info' );
// Replace the blog loop with custom loop
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'bds_do_custom_loop' );
@danbru1989
danbru1989 / events-manager-map.js
Created January 26, 2018 03:42
Scripts to change the Events Manager map zoom level, close the info window, and center on the marker.
/**
* @description This script modifies the Events Manager map
*
* @author Dan Brubaker
*
*/
// Modify Event Manager Map
jQuery(document).ready(function ($) {
jQuery(document).bind('em_maps_location_hook', function (e, map, infowindow, marker) {
.container {
background: blue;
text-align: center;
font-size: 1.6rem;
@include mq(xl) {font-size: 2rem;}
}
/* ========== PLACE GENERAL MEDIA QUERY CODE HERE ========== */
/* ===== Breakpoints ===== */
$break-point-xs : 1px;
$break-point-s : 320px;
$break-point-ms : 480px;
.video-wrapper {
position: relative;
padding-bottom: 56.25%;
}
iframe,
object,
embed {
position: absolute;
top: 0;
.map-container {
position: relative;
padding-bottom: 56.25%;
overflow: hidden;
}
.map-container iframe {
position: absolute;
top: 0;
left: 0;
table {
table-layout: fixed;
width: 100%;
}
tr {
height: 12vw; /* Set this to whatever amount forms square cells */
}