Skip to content

Instantly share code, notes, and snippets.

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"
<?php
/* Google Map WP Shortcode */
function googleMap( $atts, $content = null ) {
extract( shortcode_atts(
[
"id" => 'cpmap',
"type" => 'road',
@ylkyrg
ylkyrg / jump-menu.js
Created October 8, 2018 13:21
Active class for jump nav by id
(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");
<?php
/**
* Return an asociative array of nationalities
*
* @return array
*/
function get_nationalities() {
return [
'Irish' => 'Irish',
@ylkyrg
ylkyrg / WPUserProfilesCMB2.php
Last active February 19, 2020 10:40
WP User Profiles + CMB2
<?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
@ylkyrg
ylkyrg / hsns
Created March 6, 2020 16:02
Script to add a new site to Homestead.yaml
#!/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 / optimise-google-fonts.php
Created July 5, 2020 16:02
WordPress plugin to optimise google fonts.
<?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
*/