Skip to content

Instantly share code, notes, and snippets.

Avatar
Golfing

Jesus Lizama hellojebus

Golfing
View GitHub Profile
@hellojebus
hellojebus / example-usage.html
Last active Aug 27, 2020
Lazyload function
View example-usage.html
<!-- Background Image Usage -->
<div data-lazyload="bg" data-lazyload-src="https://path/to/image.jpg"></div>
<!-- Image Usage -->
<img data-lazyload="img" data-lazyload-src="https://path/to/image.jpg" />
@hellojebus
hellojebus / index.html
Created Nov 22, 2019
Consistent Colors, no DB needed
View index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body id="body">
View tmp
/* Colors */
/*** default font 15/22 **/
* {
margin: 0;
border: none;
padding: 0;
}
html,
View check for 404's in blog
/*
* This piece of code checks to see if the 404ing URL exists under blog
* if so, redirects to the page, if not render normal 404 page
* */
$tmpUrl = "https://".$_SERVER["SERVER_NAME"]."/blog". $_SERVER["REQUEST_URI"];
//check for trailing slash
if(substr($tmpUrl, -1) == '/') {
$tmpUrl = substr($tmpUrl, 0, -1);