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 | |
/** | |
* Wordpress RSS Image Enclosure | |
* | |
* Wrap ONLY the featured image inside 'enclosure' tags. | |
* | |
* @author Davey Jacobson | |
* @link https://www.daveyjake.dev | |
* | |
* @package DJ_Dev |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
Locale Identifier | Description | |
---|---|---|
af | Afrikaans | |
af-NA | Afrikaans (Namibia) | |
af-ZA | Afrikaans (South Africa) | |
agq | Aghem | |
agq-CM | Aghem (Cameroon) | |
ak | Akan | |
ak-GH | Akan (Ghana) | |
am | Amharic | |
am-ET | Amharic (Ethiopia) |
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
# | |
# CORS header support | |
# | |
# One way to use this is by placing it into a file called "cors_support" | |
# under your Nginx configuration directory and placing the following | |
# statement inside your **location** block(s): | |
# | |
# include cors_support; | |
# | |
# As of Nginx 1.7.5, add_header supports an "always" parameter which |
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 | |
/** | |
* Custom WordPress function to check if the HTML body `class` attribute | |
* contains one or many specified `className` values. | |
* | |
* @author Davey Jacobson <[email protected]> | |
* @version 1.0.0 | |
*/ | |
if ( ! function_exists( 'body_has_class' ) ) { | |
/** |
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 | |
/** | |
* Constants for the exact number of seconds in any given year and in any given | |
* month on the Gregorian calendar. Meant to be used in place of the current | |
* 'YEAR_IN_SECONDS' and 'MONTH_IN_SECONDS' integrations found in | |
* {@link https://codex.wordpress.org/Easier_Expression_of_Time_Constants|WordPress}. | |
* | |
* @author Davey Jacobson <[email protected]> | |
* @package DJ_Exact_Year_Month_Time_Constants | |
*/ |
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 | |
/** | |
* From the vessel that was this author... | |
* | |
* "Why this is simply... WONDERFUL! I have now entered this vessel known as | |
* 'GEETHUB' and, yes, my reign is now uponeth your precious CODE! We | |
* now begin the FINAL DELETION!" | |
* | |
* From the vessel that is, once again, this author... | |
* |
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 | |
/** | |
* Use `Lodash` as the drop-in replacement for Underscore in WordPress. | |
* | |
* This script uses the `CDNJS` API to ensure the latest version of Lodash is | |
* always retrieved. By default, Lodash will run only on the WordPress frontend | |
* unless the `$sitewide` parameter is set to `true`. | |
* | |
* @author Davey Jacobson <[email protected]> | |
* @package Davey_Jacobson |
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 | |
/** | |
* Simple function to check if it's currently a 'leap year'. | |
* | |
* @return bool True if it is. False if not. | |
*/ | |
function is_leap_year() { | |
// Ensure that '0' isn't read as boolean. | |
$zero = (int) 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
/** | |
* Get your current external IP address for the iStat Pro dashboard widget. | |
* | |
* For those of us who refuse to let go of the iStat Pro dashboard widget (version 4.9.2), | |
* this function is located inside of `~/Library/Widgets/iStat\ Pro.wdgt/scripts/core.js` | |
* beginning at line 243. As of when this Gist was published, Bjango killed the endpoint | |
* that powered their external IP address service. Thankfully, there's | |
* {@link https://www.ipify.org}, a free public IP API endpoint. Simply copy and paste the | |
* function below over the predecessor inside the core.js file and the IP service is | |
* restored (once again). |
OlderNewer