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
const http = require('https') | |
// Nanoseconds per second 1000000 | |
const NS_PER_SEC = 1e6 | |
// In order to convert to ms, process.hrtime() must be declared previously | |
const time = process.hrtime(); | |
// Gather the data | |
const req = http.request(process.argv[2], res => { | |
res.setEncoding('utf8') |
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
// Add to theme functions.php (Tested on WordPress 5.0.3) | |
<?php | |
function post_fetured_image_json( $data, $post, $context ) { | |
$featured_image_id = $data->data['featured_media']; // get featured image id | |
$featured_image_url = wp_get_attachment_image_src( $featured_image_id, 'original' ); // get url of the original size | |
if( $featured_image_url ) { | |
$data->data['featured_image_url'] = $featured_image_url[0]; |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wuauserv] | |
"DependOnService"=hex(7):72,00,70,00,63,00,73,00,73,00,00,00,00,00 | |
"Description"="@%systemroot%\\system32\\wuaueng.dll,-106" | |
"DisplayName"="@%systemroot%\\system32\\wuaueng.dll,-105" | |
"ErrorControl"=dword:00000001 | |
"FailureActions"=hex:80,51,01,00,00,00,00,00,00,00,00,00,03,00,00,00,14,00,00,\ | |
00,01,00,00,00,60,ea,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 | |
"ImagePath"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,6f,00,\ |
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
// Credits: https://stackoverflow.com/a/61629055/5981004 | |
useEffect(() => { | |
const delayDebounceFn = setTimeout(() => { | |
// HTTP | |
}, 500) | |
return () => clearTimeout(delayDebounceFn) | |
}, [input]) |
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
import useOutsideClick from './useOutsideClick'; | |
export default () => { | |
useOutsideClick(useRef, () => { | |
// Update state or whatever | |
}) | |
return <></> | |
} |