This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Creator: Phil Cook | |
# Modified: Andy Miller (2020-11-27) | |
# Modified: Chauncey McAskill (2022-09-21) | |
osx_major_version=$(sw_vers -productVersion | cut -d. -f1) | |
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2) | |
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3) | |
osx_patch_version=${osx_patch_version:-0} | |
osx_version=$((${osx_major_version} * 10000 + ${osx_minor_version} * 100 + ${osx_patch_version})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!function_exists('strip_html')) { | |
/** | |
* Strip HTML and PHP tags from a string. | |
* | |
* @param string $str The input string. | |
* @return string Returns the stripped string. | |
*/ | |
function strip_html($str) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Alias of `composer` command that, if Composer's installed.json is present, checks | |
# for local changes in dependencies and backs-up the composer.json, composer.lock, | |
# and vendor directory before executing install, reinstall, or update commands. | |
# | |
# Useful if you often need to modify the code of your dependencies and they are | |
# installed from source. | |
# | |
# Version: 1.1.0 | |
# License: MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Prepends a leading slash. | |
* | |
* Will remove leading forward and backslashes if it exists already before adding | |
* a leading forward slash. This prevents double slashing a string or path. | |
* | |
* The primary use of this is for paths and thus should be used for paths. It is | |
* not restricted to paths and offers no specific path support. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
const table = document.getElementById('my-table'); | |
let lastInput = null; | |
table.addEventListener('click', function (event) { | |
const currInput = event.target; | |
if (currInput.type !== 'checkbox') { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
const table = document.getElementById('my-table'); | |
const store = window.localStorage; | |
table.querySelectorAll('[type="checkbox"]').forEach(function (input) { | |
input.checked = !!store.getItem(`${input.name}_${input.value}`); | |
}); | |
table.addEventListener('change', function (event) { | |
let input = event.target; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!function_exists('array_insert')) { | |
/** | |
* Insert an array into another array before/after a certain key | |
* | |
* Merge the elements of the $array array after, or before, the designated $key from the $input array. | |
* It returns the resulting array. | |
* | |
* @param array $input The input array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!function_exists('is_var_empty')) { | |
/** | |
* Determine whether a variable is empty. | |
* | |
* Alternative to {@see empty()} which will resolve stringable and arrayable objects. | |
* | |
* @param mixed $var The value to be checked. | |
* @return boolean Returns FALSE if var exists and has a non-empty value. Otherwise returns TRUE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!function_exists('get_var_type')) { | |
/** | |
* Get the type, resource name, or class name of a variable. | |
* | |
* Returns the type (name if an object or resource) of the PHP variable $var. | |
* | |
* @link http://php.net/manual/en/function.gettype.php#104224 | |
* @param mixed $var The variable being type checked. |