Skip to content

Instantly share code, notes, and snippets.

@filkris
filkris / .htaccess
Created July 29, 2020 22:29
Apache force https and non-www or www
<IfModule mod_rewrite.c>
RewriteEngine On
# Do not use both
# (1) Force HTTPS and NON-WWW
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
@filkris
filkris / bs-4-sticky-footer-example.html
Created July 29, 2020 01:06
Bootstrap 4 Sticky Footer Snippet
@filkris
filkris / bs4-tabs-accordion-example.html
Created February 7, 2020 01:26
Bootstrap 4 Responsive Tabs to Accordion Snippet
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Responsive Nav Tabs to Accordion Snippet">
<meta name="author" content="Filkris">
<title>Bootstrap 4 Responsive Nav Tabs to Accordion Snippet</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<!-- Snippet start -->
@filkris
filkris / px_to_rem.scss
Created January 22, 2020 10:04
Simple SASS function to convert px to rem units
@function rem($value) {
@return #{($value/1px)/16}rem;
}
// Example
p {
font-size: rem(16px);
}