Skip to content

Instantly share code, notes, and snippets.

View adkvolks's full-sized avatar

Jonathan Volks adkvolks

View GitHub Profile
@adkvolks
adkvolks / style.css
Created November 22, 2025 04:33
CSS Fluid Scaling Between Screen Size
.container {
display: flex;
column-gap: clamp(1rem, calc(1rem + (4rem - 1rem) * ((100vw - 992px) / (1280px - 992px))), 4rem);
}
.column {
flex-basis: 50%;
height: 500px;
background-color: green;
}
@adkvolks
adkvolks / .htaccess
Last active November 21, 2025 05:06
WWW and SSL redirect
# Non-WWW to WWW Redirect
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301]
# WWW to Non-WWW Redirect
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^domain\.com$ [NC]
@adkvolks
adkvolks / wordpress.php
Last active November 21, 2025 05:17
Wordpress_Image_Sizes
<?php
// In your Functions.php file
add_action("after_setup_theme", function() {
add_image_size("custom-thumbnail", 600, 400, true);
add_image_size("custom-thumbnail-2", 800, 800, false);
});
// Use in your template
@adkvolks
adkvolks / wordpress.php
Last active November 21, 2025 05:21
Wordpress - Shortcode
<?php
add_shortcode("greeting", function() {
return "<h2>Hello from my shortcode!</h2>";
});