Skip to content

Instantly share code, notes, and snippets.

View Homezonic's full-sized avatar

Akande Joshua Homezonic

View GitHub Profile
@Homezonic
Homezonic / .phpcsfixer
Last active April 11, 2023 00:43 — forked from sarthaksavvy/.phpcsfixer
PHP CS Fixer for latest version compatibility (tested upto v3.16.0)
<?php
return (new PhpCsFixer\Config())
->setRules([
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_unsets' => true,
'phpdoc_separation' => true,
'multiline_whitespace_before_semicolons' => true,
@Homezonic
Homezonic / Simple Maintenance HTML
Created April 24, 2021 10:21
Short and Simple Maintenance Page
<!doctype html>
<title>Site Under Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@Homezonic
Homezonic / autologout.php
Last active June 21, 2019 18:00 — forked from psdtohtml5/gist:6090113
PHP : Auto expire session / Auto logout after specific time
<?php
//on pageload, we have to start the session.
session_start();
$idletime=60;// after 60 seconds the user gets logged out, put your time in seconds.
if (time()-$_SESSION['timestamp']>$idletime){
session_destroy();
session_unset();
header('Location: ../index.php'); //then redirect the user away from the current page to a lockscreen page or index.