Skip to content

Instantly share code, notes, and snippets.

@royce002
royce002 / .htaccess
Created June 3, 2022 15:29
Redirect to https and non-www .htaccess
# Canonical HTTPS/non-WWW
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule (.*) https://example.com/$1 [L,R=301]
</IfModule>
@royce002
royce002 / .htaccess
Created March 4, 2021 22:14
.htaccess script to redirect all traffic to https with no wwws.
# Redirect to https and non-www
# Canonical HTTPS/non-WWW
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule (.*) https://example.com/$1 [L,R=301]
</IfModule>
@royce002
royce002 / gsap-week4-scrolling-challenges-june-2020.markdown
Created November 23, 2020 17:55
GSAP - 頁面捲動動畫效果 (week4 scrolling challenges June 2020)

GSAP - 頁面捲動動畫效果 (week4 scrolling challenges June 2020)

利用 GSAP ScrollTrigger Pluging 製作簡單頁面捲動動畫效果

A Pen by RayPan on CodePen.

License.

@royce002
royce002 / GSAP Full Screen Scrolliing
Last active April 27, 2023 14:04
Parallax GSAP Scroll Trigger
<body>
<nav>
<img src="https://bit.ly/2NKLFXr" alt="">
<div>
<ul id="ul-menu">
<li><a id="menu_link" href="#section_beaches">Beaches</a></li>
<li><a id="menu_link" href="#section_temples">Civlization</a></li>
<li><a id="menu_link" href="#section_places">Places</a></li>
</ul>
@royce002
royce002 / get_php_not_empty.php
Created October 14, 2020 17:50
Get a php variable from the url and ensure it's not empty
<?php
if (!empty($_GET['variable'])) {
// Do something.
}
?>
<?php
function isRussian($text) {
return preg_match('/[А-Яа-яЁё]/u', $text);
}
?>
@royce002
royce002 / Bootstrap 4.5 Carousel.htm
Created September 9, 2020 17:43
Carousel for Bootstrap 4.5
@royce002
royce002 / bootstrap-4.5.2.htm
Created August 26, 2020 20:36
Starter template for bootstrap 4.5.2
<!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="">
<meta name="author" content="">
<title>Bootstrap 4.5.2 Starter Template</title>
<!-- Bootstrap core CSS -->
(http(s?):)([/|.|\w|\s|-])*\.(?:jpg|gif|png)