Skip to content

Instantly share code, notes, and snippets.

Avatar

Gary Kealy ylkyrg

View GitHub Profile
@ylkyrg
ylkyrg / optimise-google-fonts.php
Created Jul 5, 2020
WordPress plugin to optimise google fonts.
View optimise-google-fonts.php
<?php
/**
* Plugin Name: Optimise Google Fonts
* Description: Add optimisations for loading Google Fonts.
* Version: 0.1.0
* Author: Gary Kealy
* Author URI: https://garykealy.dev
* License: GNU General Public License v2 or later
*/
@ylkyrg
ylkyrg / hsns
Created Mar 6, 2020
Script to add a new site to Homestead.yaml
View hsns
#!/bin/sh
#####################################################
# Add new site to Homestead.yaml
#####################################################
#
# This scipt assumes the new site is already in a
# mapped directory and that is that its parent
# directory is the same as the domain.
#
@ylkyrg
ylkyrg / WPUserProfilesCMB2.php
Last active Feb 19, 2020
WP User Profiles + CMB2
View WPUserProfilesCMB2.php
<?php
/**
* WP User Profiles + CMB2
*
* CMB2 user meta doesn't play very nicely with WP User Profiles. This
* class is an example of getting them to work together.
*
* @see https://github.com/CMB2/CMB2
* @see https://github.com/stuttter/wp-user-profiles
View countries.php
<?php
/**
* Return an asociative array of nationalities
*
* @return array
*/
function get_nationalities() {
return [
'Irish' => 'Irish',
@ylkyrg
ylkyrg / jump-menu.js
Created Oct 8, 2018
Active class for jump nav by id
View jump-menu.js
(function($) {
$(window).scroll(function() {
var scroll = $(window).scrollTop();
// Active class for jump nav
$("section").each(function(i) {
var id = $(this).attr("id");
if ($(this).offset().top <= scroll + 200) {
$(".navbar .nav-item").removeClass("active");
View wp-map-shortcode.php
<?php
/* Google Map WP Shortcode */
function googleMap( $atts, $content = null ) {
extract( shortcode_atts(
[
"id" => 'cpmap',
"type" => 'road',
View boxstarter.txt
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowFileExtensions -EnableShowFullPathInTitleBar
Set-TaskbarOptions -Size Small
cinst php
cinst composer
cinst nvm.portable
cinst microsoft-windows-terminal
cinst git --params "/GitAndUnixToolsOnPath /WindowsTerminal"