Skip to content

Instantly share code, notes, and snippets.

Avatar

Steve Obbayi steveobbayi

View GitHub Profile
@steveobbayi
steveobbayi / timedatectl list-timezones
Created Jan 7, 2021 — forked from adamgen/timedatectl list-timezones
An online display timedatectl list-timezones list
View timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
View wpremovehook.php
<?php
function child_remove_parent_function() {
remove_action( 'init', 'parent_function', 10 );
}
add_action( 'wp_loaded', 'child_remove_parent_function' );
View wpfunctionpriorty.php
<?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.
View functionexists.php
<?php
if ( ! function_exists ( 'my_function' ) ) {
function my_function() {
// Contents of your parent theme function here.
}
}
function my_function() {
View main.qml
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.
View php-http-to-https-2.php
<?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' )
)
)
{
View htaccess-http-to-https.txt
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
View wordpress-htaccess.txt
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
View get-client-ip-address.php
<?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'];
View http-request-methods.php
<?php
$request_method = $_SERVER['REQUEST_METHOD'];
switch ($request_method) {
case 'GET':
//Handle GET Request here
break;
case 'POST':
//Here Handle POST Request here