git init
or
<?php | |
$image = imagecreatefromjpeg($_GET['src']); | |
$filename = 'images/cropped_whatever.jpg'; | |
$thumb_width = 200; | |
$thumb_height = 150; | |
$width = imagesx($image); | |
$height = imagesy($image); |
/** | |
* frontpage check | |
*/ | |
$menu = JFactory::getApplication()->getMenu(); | |
$defaultmenuitems = array($menu->getDefault()->id, $menu->getDefault(JFactory::getLanguage()->getTag())->id); | |
$isFrontpage = in_array($menu->getActive()->id, $defaultmenuitems); |
<?php | |
/** | |
* Password Reset Script | |
* | |
* This command line script can be run as a cron job or on user request to flag user accounts on a site | |
* as requiring their passwords reset. This script flags all users who have not reset their passwords | |
* in the number of days specified by the user and compares to the lastResetTime column in the #__users | |
* table. | |
* | |
* The number of days can be specified in one of two manners: |
<?php | |
/** | |
* @package MyExtension.Library | |
* @subpackage Helper | |
* | |
* @copyright Copyright (C) 2014 Roberto Segura. All rights reserved. | |
* @license GNU General Public License version 2 or later; see LICENSE | |
*/ | |
defined('_JEXEC') or die; |
# === Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers) === | |
# | |
# by Fotis Evangelou, developer of Engintron (engintron.com) | |
# | |
# ~ Updated September 2024 ~ | |
# | |
# | |
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores. | |
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage. | |
# |
function countdown(endDate) { | |
let days, hours, minutes, seconds; | |
endDate = new Date(endDate).getTime(); | |
if (isNaN(endDate)) { | |
return; | |
} | |
setInterval(calculate, 1000); |
let request = new XMLHttpRequest(), | |
requestUrl = '', // Указываем url запроса | |
formData = new FormData(); // Перадаем <form> или просто добавляем ниже через append что нужно | |
request.open('POST', requestUrl); | |
request.send(formData); | |
request.onreadystatechange = function () { | |
if (this.readyState === 4 && this.status === 200) { | |
let response = false; | |
try { |
<?php | |
/** | |
* getDominantColor | |
* Получение доминантного цвета. Функция требует наличия библиотеки GD. | |
* | |
* @param string $fname полный путь к файлу относительно сервера | |
* @param bool $skipBlackAndWhite пропускать чисто белый и чисто чёрный тона | |
* @return array | |
*/ |