Skip to content

Instantly share code, notes, and snippets.

View smutek's full-sized avatar

Jimmy Smutek smutek

View GitHub Profile
@smutek
smutek / Bootstrap5NavWalker.md
Last active December 28, 2023 12:54
Bootstrap 5 Nav Walker for Sage 10

Bootstrap 5 Walker for Sage 10

Adds Bootstrap 5 css classes to the nice Soil nav walker in a Sage 10 project.

Assumptions

  • Assumes you're using Sage 10.
  • Assumes the Roots/Soil plugin is installed and activated.
  • Assumes Tailwind has been removed from the Sage project and Bootstrap 5 has been added.
@smutek
smutek / Bootstrap4Nav-Sage9.md
Last active July 30, 2022 06:50
Bootstrap 4 Walker for Sage 9

Credit

This is a frankensteind version of the current Soil nav walker, by the Roots team, and Michael Remoero's Sagextras walker. All credit goes to those good folks. :)

Use

  • Replace the contents of header.blade.php with the attached header.
  • Copy the walker.php file to the /app directory.
  • Add walker.php to the Sage required files array in resources/functions.php - eg. on a stock Sage install the entry would look like:
/**
@smutek
smutek / content-page.blade.php
Last active February 16, 2022 16:11
Simple Sage 9 Slider with Slick
@php(the_content())
@if($images)
@include('partials/slider')
@endif
@smutek
smutek / inspect.php
Created June 15, 2015 15:17
lists handles for all enqueued styles and scripts
/*
* Lists out the handles for all enqueued styles and scripts.
* Credit: http://wordpress.stackexchange.com/questions/54064/how-do-i-get-the-handle-for-all-enqueued-scripts
*/
function wp_inspect_scripts() {
global $wp_scripts;
echo '<pre><h1>Script Handles</h1><ul>';
foreach( $wp_scripts->queue as $handle ) :
echo '<li>' . $handle . '</li>';
@smutek
smutek / clearDock.bash
Last active August 9, 2020 21:46
Clear the OS X dock
# Overwrite persistent-apps array in defaults with an empty array
# run in console, save as an alias, whatever. See man defaults for more infoz
# ht: https://krypted.com/mac-security/remove-all-apps-from-the-dock-in-os-x/
defaults write com.apple.dock persistent-apps -array && killAll Dock
@smutek
smutek / post_format_icon.php
Created March 9, 2016 03:22
Function for Post Format icons
<?php
/**
* Output Post Format icons
*
* Outputs an icon for each post format. Set up to use Fontawesome,
* but can be used with anything, or you can just use CSS.
*
* @return string
*/
function post_format_icon() {
@smutek
smutek / vvv-fedora-25.md
Created February 11, 2017 19:22
Install VVV on Fedora 25

Installing Virtualbox, Vagrant, and VVV on Fedroa 25 requires a few extra steps.

Install Vagrant and Virtual Box

Follow the instructions here to install Virtual Box and Vagrant.

Install Ruby Tools

Add necessary Ruby tools neded to install vagrant plugins.

  • Ruby Devel: sudo dnf install ruby-devel
@smutek
smutek / CreateAlertComponent.java
Created September 15, 2018 23:08
CMIS 141 Week 4 Discussion
/*
* File: CreateAlertComponent.java
* Author: James Smutek
* Date: September 15, 2018
* Purpose: Create instances of Twitter Bootstrap's "Alert" Web Component
* @see: https://getbootstrap.com/docs/4.0/components/alerts/
*/
public class CreateAlertComponent {
// Variables
private int modifierKey;
@smutek
smutek / addSimplenote.sh
Created January 22, 2017 21:35
Setup Simplenote on Fedora 25. Assumes Simplenote has been added to /opt/
SHORTCUT="[Desktop Entry]
Name=SimpleNote
Comment=Edit text files
Exec=/opt/Simplenote-linux-x64/Simplenote
Icon=/opt/Simplenote-linux-x64/Simplenote.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;TextEditor;"
<?php
/**
* Gravity Forms : Check if file is attached
*
* Send a different notification email depending on whether a file is attached or not.
*
* For some reason the file upload field is not available to use with conditional logic
* when processing a gravity forms submission. So you cannot by default do something
* like perform one action if a file is attached and perform another if it is not.
*