Skip to content

Instantly share code, notes, and snippets.

View karvas's full-sized avatar

Vasileios Karantousis karvas

View GitHub Profile
@chadrehm
chadrehm / ScrollToTopArrow.js
Created November 6, 2020 16:38
ScrollToTopArrow
export const ScrollTopArrowComponent = () => {
// Track whether the scroll arrow is needed.
const [showScroll, setShowScroll] = useState(null);
// Check the scroll state, re-memoize when scroll state changes.
const checkScrollTop = useCallback(
() => {
const headerHeight = 400;
if (!showScroll && window.pageYOffset > headerHeight) {
setShowScroll(true);
@tomhicks
tomhicks / plink-plonk.js
Last active December 26, 2025 08:35
Listen to your web pages
@Log1x
Log1x / functions.php
Created March 7, 2019 16:38
Remove noopener & noreferrer on WordPress links
/**
* Remove rel="noopener noreferrer" in TinyMCE links
*
* @param array $init
* @return array
*/
add_filter('tiny_mce_before_init', function ($init) {
$init['allow_unsafe_link_target'] = true;
return $init;
});