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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Lazy load youtube embed</title> | |
<meta charset="UTF-8" /> | |
</head> | |
<body> | |
<main> | |
<h1>Example of a lazy loaded embedded YouTube video</h1> | |
<iframe |
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
/** | |
* Register hero block | |
*/ | |
add_action('acf/init', 'hero'); | |
function hero() { | |
// check function exists | |
if( function_exists('acf_register_block') ) { | |
// register a hero block |
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
Status Code URL IP Page Type Redirect Type Redirect URL | |
302 https://astro.family/Clintus 67.199.248.13 server_redirect temporary http://www.avantlink.com/click.php?tt=cl&merchant_id=a9357ec0-3e82-4d28-beb7-8f1a7468ca28&website_id=e00bfdff-cfb5-4645-bd88-ebb2d1f7c63a&url=http://buy.astrogaming.com/store/logib2c/html/pbPage.astro-affiliate/OfferID.60188315901/ThemeID.4807228000 | |
302 http://www.avantlink.com/click.php?tt=cl&merchant_id=a9357ec0-3e82-4d28-beb7-8f1a7468ca28&website_id=e00bfdff-cfb5-4645-bd88-ebb2d1f7c63a&url=http://buy.astrogaming.com/store/logib2c/html/pbPage.astro-affiliate/OfferID.60188315901/ThemeID.4807228000 54.158.229.114 server_redirect temporary https://classic.avantlink.com/click.php?tt=cl&merchant_id=a9357ec0-3e82-4d28-beb7-8f1a7468ca28&website_id=e00bfdff-cfb5-4645-bd88-ebb2d1f7c63a&url=http://buy.astrogaming.com/store/logib2c/html/pbPage.astro-affiliate/OfferID.60188315901/ThemeID.4807228000 | |
302 https://classic.avantlink.com/click.php?tt=cl&merchant_id=a9357ec0-3e82-4d28-beb7-8f1a7468 |
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
// API specific settings https://openweathermap.org/current | |
const API_URL = 'https://api.openweathermap.org/data/2.5/weather'; | |
const API_KEY = ''; | |
const LOCATION_CODE = ''; | |
const FULL_API_URL = `${API_CURRENT_URL}?id=${LOCATION_CODE}&appid=${API_KEY}`; | |
axios | |
.get(FULL_API_CURRENT_URL) | |
.then(response => { | |
// Assign vars to response data |
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
{ | |
"id": "average", | |
"metadata": { | |
"operation": "retrieve", | |
"provider": "Oxford University Press", | |
"schema": "RetrieveEntry" | |
}, | |
"results": [ | |
{ | |
"id": "average", |
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 | |
// basic idea here is a common function to pass a parent page ID | |
// and get back an array of it and its child page IDs only | |
function getChildPageIDs( $id ) { | |
$child_pages = get_pages('child_of='.$id); | |
$ids_to_remove = array($id); // we want to remove parent id too | |
foreach($child_pages as $child) { | |
array_push($ids_to_remove,$child->ID); // for every child add the id into array | |
} |
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 | |
/** | |
* Remove jQuery Migrate script | |
*/ | |
function ryno_remove_jquery_migrate( $scripts ) { | |
if ( isset( $scripts->registered['jquery'] ) ) { | |
$script = $scripts->registered['jquery']; | |
if ( $script->deps ) { // Check whether the script has any dependencies | |
$script->deps = array_diff( $script->deps, array( 'jquery-migrate' ) ); |
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 | |
$url = 'https://icanhazdadjoke.com/'; | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Accept:text/plain']); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$data = curl_exec($ch); | |
curl_close($ch); | |
echo $data; |
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
{ | |
"username":"twitch.tv/{{ChannelName}} [via RynoBot]", | |
"content":"@everyone {{ChannelName}} just went LIVE on Twitch! See you in chat! clintusHYPE", | |
"embeds":[ | |
{ | |
"title":"{{ChannelUrl}}", | |
"url":"{{ChannelUrl}}", | |
"color":6570404, | |
"thumbnail":{ | |
"url":"https://static-cdn.jtvnw.net/jtv_user_pictures/b26daa03-975b-4a5d-9dea-a7fe9505a63f-profile_image-300x300.png" |
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
<html> | |
<head> | |
<style> | |
.wrapper { | |
display: grid; | |
grid-template-columns: repeat(auto-fill, minmax(200px, 220px)); | |
grid-gap: 20px; | |
} | |
.box { | |
background-color: #ebebeb; |