This file contains hidden or 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 | |
/** | |
* This is such a common thing, I decided to put it in a gist so I don't have to keep reinventing it every time LOL. | |
*/ | |
function substr_to($haystack, $needle) { | |
$iPos = strpos($haystack, $needle); | |
if($iPos === false) { | |
return false; | |
} | |
return substr($haystack, 0, $iPos); |
This file contains hidden or 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
/** | |
* @param {string} value The text to copy to the clipboard | |
* This method is designed to circumvent the inability to copy test from an inactive textarea, | |
* Hopefully it gets the keyboard to drop off on mobile too | |
*/ | |
copyToClipboard = () => { | |
const tmpTextArea = document.createElement('textarea'); | |
const newContent = document.createTextNode(this.props.getText()); | |
tmpTextArea.appendChild(newContent); | |
tmpTextArea.style.width = 0; |
This file contains hidden or 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
// Using thephpleague/oauth1-client | |
// https://github.com/thephpleague/oauth1-client | |
require_once __DIR__.'/../../vendor/autoload.php'; | |
// Create server | |
$server = new League\OAuth1\Client\Server\Magento(array( | |
'identifier' => $data['consumerKey'], | |
'secret' => $data['consumerSecret'], | |
'callback_uri' => "http://mage-access.local/oath.php/", |
This file contains hidden or 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
/** | |
* https://www.embracepetinsurance.com/waterbowl/article/measuring-my-cats-body-mass-index-the-fbmi | |
* | |
* ribCage float Circumference of your cat's rib cage in inches. (The level of the 9th rib is ideal). | |
* legLength float Length in inches of your cat's rear leg from knee to ankle. | |
* | |
* If the result is >= 42, your cat is overweight! | |
*/ | |
function catBmi(ribCage, legLength) { | |
return (ribCage / .7062 - legLength) / .9156 - legLength; |
OlderNewer