Skip to content

Instantly share code, notes, and snippets.

View kevinwhoffman's full-sized avatar

Kevin W. Hoffman kevinwhoffman

View GitHub Profile
@mathetos
mathetos / plugin.php
Last active April 13, 2023 16:48
Dependent Plugin Activation/Deactivation and Alert
<?php
/*
* Dependent Plugin Activation/Deactivation
*
* Sources:
* 1. https://pippinsplugins.com/checking-dependent-plugin-active/
* 2. http://10up.com/blog/2012/wordpress-plug-in-self-deactivation/
*
*/
@ethicka
ethicka / wp-start.sh
Last active December 27, 2023 07:10
WordPress Installation with the Roots/Sage Framework and VirtualHost Creation
#!/bin/bash -e
##
# WordPress Installation and VirtualHost Creation
#
# Description: Installs a WordPress website in the ~/Sites folder, creates a homepage,
# cleans up the WP install a bit, deletes the akismet and hello dolly plugins, creates the permalinks,
# clones the roots/sage theme framework to the theme folder, deletes all the other WP default themes,
# installs/runs npm and bower and runs gulp to create the initial assets, adds a custom gitignore file
# to /wp-content, installs the roots/soil plugin, creates a git repo in wp-content, saves the WordPress
@kevinwhoffman
kevinwhoffman / resources-web-developers-designers.md
Last active August 1, 2024 06:59
Resources for Web Developers and Designers

Resources for Web Developers and Designers

This is an incomplete list of resources including courses and individuals who publish content that has helped me grow as a web developer and designer. Many of these resources are WordPress-specific as that is my current area of specialization. This list will grow over time. If you've got something to add, send me a link @kevinwhoffman and I'll check it out!

Course Providers

@tomhodgins
tomhodgins / element-query-mixin.es5.js
Last active January 7, 2018 21:37
Element Query JS-in-CSS Mixin, you supply a CSS selector, custom conditions, and a stylesheet with $this as a placeholder selector for matching elements. Use like: element('textarea', {minCharacters: 5}, `$this { background: lime; }`)
function element(selector, conditions, stylesheet) {
var features = {
minWidth: function(el, number) { return number <= el.offsetWidth },
maxWidth: function(el, number) { return number >= el.offsetWidth },
minHeight: function(el, number) { return number <= el.offsetHeight },
maxHeight: function(el, number) { return number >= el.offsetHeight },
minChildren: function(el, number) { return number <= el.children.length },
maxChildren: function(el, number) { return number >= el.children.length },
minCharacters: function(el, number) { return number <= ((el.value && el.value.length) || el.textContent.length) },