Skip to content

Instantly share code, notes, and snippets.

View hyptx's full-sized avatar

Adam J Nowak hyptx

View GitHub Profile
.bg-gray{background:#efefef;}
.full-bg{box-shadow:0 0 0 100vmax #efefef; clip-path: inset(0 -100vmax);}
@hyptx
hyptx / Vite Start
Created October 3, 2022 19:07
Command to create new vite project
npm create vite@latest
@hyptx
hyptx / BSPlugins
Last active September 30, 2022 00:31
Init for bootstrap plugins
//Popover
const popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'));
const popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
return new Popover(popoverTriggerEl);
})
//Tooltip
const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
const tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new Tooltip(tooltipTriggerEl);
});
@hyptx
hyptx / Redirect development
Created March 31, 2022 17:23
Redirect certain pages for development
//TEMP REMOVE GO LIVE
function redirect_if_user_not_logged_in() {
global $post;
$show_live_pages = [3,46];
if(in_array($post->ID, $show_live_pages)) return;
if(is_admin()) return;
if (!is_user_logged_in() && !is_front_page()) {
wp_redirect( 'https://northernfeedandbean.com');
exit;
}
@hyptx
hyptx / RedirectAll
Created February 23, 2022 23:38
Redirect all traffic to one page or url
RewriteEngine on
RewriteCond %{HTTP_HOST} ^franchise\.seniorshelpingseniors\.com [NC]
RewriteCond %{REQUEST_URI} !^/$ [NC]
RewriteRule ^.*$ http://seniorshelpingseniorsfranchise.com/ [L]
@hyptx
hyptx / Postswithfeatured
Created February 16, 2022 17:50
Get posts with featured images
$args = array(
'post_type' => 'resources',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => '_thumbnail_id',
'compare' => 'EXISTS'
),
)
);
@hyptx
hyptx / Hide vertical scrollbar
Created January 25, 2022 17:58
Hide scrollbars webkit
.video-left #content-right{
-ms-overflow-style: none; /* for Internet Explorer, Edge */
scrollbar-width: none; /* for Firefox */
overflow-y: scroll;
}
.content-scroller::-webkit-scrollbar {
display: none; /* for Chrome, Safari, and Opera */
}
@hyptx
hyptx / FlexVert
Created January 20, 2022 17:32
Flex Vertical Align
.v-aligner{display: flex; align-items: center; justify-content: center;}
.v-aligner-item-top{align-self: flex-start;}
.v-aligner-item-bottom{align-self: flex-end;}
@hyptx
hyptx / mincontentfooter
Created November 11, 2021 21:34
Min height to keep footer at bottom when minimal content
#main{ min-height: calc(100vh - 277px);}
@hyptx
hyptx / AOSGroup
Created October 27, 2021 17:24
AOS attributes for wp group
//AOS Block Filter
function exl_aos_filter( $block_content, $block ){
//Schema exlaos_fade-up_1000 ETC
//1 data-aos="fade-up"
//2 data-aos-duration="1000"
//3 data-aos-delay="50"
//4 data-aos-offset="200"
//5 data-aos-easing="ease-in-out"
//data-aos-mirror="true"
//data-aos-once="false"