This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
///////////////////////////////////////////////////////////////////////////////////////////////////////// | |
/// To run this script as a cronjob once a day, you can add a new entry to the crontab file using the /// | |
/// crontab -e command and specifying the desired time for the backup to be created. For example, to //// | |
/// run the backup script every day at midnight, you can add the following line to the crontab file: //// | |
/// 0 0 * * * /usr/bin/php /path/to/backup-script.php >/dev/null 2>&1 /////////////////////////////////// | |
///////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// Set the path to the source directory to be backed up |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
///////////////////////////////////////////////////////////////////////////////////////////////////// | |
/// Run the following command in SSH to install the dependency (i.e. "fabpot/goutte"): ////////////// | |
/// composer require fabpot/goutte ////////////////////////////////////////////////////////////////// | |
///////////////////////////////////////////////////////////////////////////////////////////////////// | |
/// 1. Get the latest version of the WooCommerce plugin from the WordPress.org plugin repository. /// | |
/// 2. Check a list of websites for the installed version of the WooCommerce plugin. //////////////// | |
/// 3. Compare the installed version with the latest version available on WordPress.org. //////////// | |
/// 4. Output the appropriate message based on the comparison results. ////////////////////////////// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
#Removes access to the system folder by users. | |
#Additionally this will allow you to create a System.php controller, | |
#previously this would not have been possible. | |
#'system' can be replaced if you have renamed your system folder. | |
RewriteCond %{REQUEST_URI} ^system.* | |
RewriteRule ^(.*)$ /index.php?/$1 [L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'https://www.toptal.com/developers/cssminifier/api/raw'; | |
// init the request, set various options, and send it | |
$ch = curl_init(); | |
curl_setopt_array($ch, [ | |
CURLOPT_URL => $url, | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_POST => true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>OpenStreetMap & OpenLayers - Marker Example</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css"> | |
<script src="https://openlayers.org/en/v4.6.5/build/ol.js" type="text/javascript"></script> | |
<script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$month = date('m'); | |
$day = date('d'); | |
$year = date('Y'); | |
function isJewishLeapYear($year) { | |
if ($year % 19 == 0 || $year % 19 == 3 || $year % 19 == 6 || | |
$year % 19 == 8 || $year % 19 == 11 || $year % 19 == 14 || | |
$year % 19 == 17) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//check if form was sent | |
if($_POST){ | |
$to = '[email protected]'; | |
$subject = 'Testing HoneyPot'; | |
$header = "From: $name <$name>"; | |
$name = $_POST['name']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_cookies( $paras = '', $content = '' ) { | |
if ( strtolower( $paras[ 0 ] ) == 'novalue' ) { $novalue = true; } else { $novalue = false; } | |
if ( $content == '' ) { $seperator = ' : '; } else { $seperator = $content; } | |
$cookie = $_COOKIE; | |
ksort( $cookie ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL); | |
/** | |
* A 'fake' Codeigniter framework for testing codeigniter-redis | |
* I seriously wrote this because it was faster than setting up another CI install, so I can | |
* work on it without breaking stuff that other people are using. | |
* Written by Tim Post <[email protected]> I take no responsibility for what comes below! | |
**/ | |
/* Provide some of the CI common functions */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Small script used to block some countries (based on ipinfodb.com database) | |
* | |
* @author @Heavenstar_ | [email protected] | |
* @version 1.0.0 | |
*/ | |
$apiKey = 'REPLACE WITH YOUR KEY'; //Get an API key here : http://ipinfodb.com/login.php | |
$apiEndpoint = 'http://api.ipinfodb.com/v3/ip-country/'; |
NewerOlder