Skip to content

Instantly share code, notes, and snippets.

View steveobbayi's full-sized avatar

Steve Obbayi steveobbayi

View GitHub Profile
@steveobbayi
steveobbayi / timedatectl list-timezones
Created January 7, 2021 21:37 — forked from adamgen/timedatectl list-timezones
An online display timedatectl list-timezones list
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
<?php
function child_remove_parent_function() {
remove_action( 'init', 'parent_function', 10 );
}
add_action( 'wp_loaded', 'child_remove_parent_function' );
<?php
function your_function() {
// Contents for your parent theme function here.
}
add_action( 'init', 'your_function', 20 );
function your_function() {
// Contents for your child function override here.
<?php
if ( ! function_exists ( 'my_function' ) ) {
function my_function() {
// Contents of your parent theme function here.
}
}
function my_function() {
ApplicationWindow {
id: root
visible: true
x: 0 // position window to the left of the screen
y: 0 // position window to the top of the screen
width: Screen.width // make window width same as screen
height: Screen.height + 1 // make window height same as screen + 1. This prevents the window being trated as fullscreen
flags: Qt.FramelessWindowHint | Qt.Window //first flag removes window decorations, second flag to keeps application thumbnail in the Windows taskbar.
<?php
if (
$_SERVER['HTTP_HOST'] != 'localhost' && // optionally disable on localhost
!(
( $_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1 ) ||
( isset($_SERVER['HTTP_X_FORWARDED_PROTO'] ) &&
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' )
)
)
{
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
<?php
function getClientIpWithServer() {
$ipaddress = '';
if (isset($_SERVER['HTTP_CLIENT_IP']))
$ipaddress = $_SERVER['HTTP_CLIENT_IP'];
else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
else if(isset($_SERVER['HTTP_X_FORWARDED']))
$ipaddress = $_SERVER['HTTP_X_FORWARDED'];
<?php
$request_method = $_SERVER['REQUEST_METHOD'];
switch ($request_method) {
case 'GET':
//Handle GET Request here
break;
case 'POST':
//Here Handle POST Request here