This file contains 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 | |
/* | |
* | |
* This script will backup your web site by remotely archiving all files on the root FTP directory. | |
* It will work even if your web server is memory limited buy splitting zips in several arhive files it they are too many files. | |
* All zip files will be stored in a directory called temporary which must be writable. | |
* | |
* How to use it: | |
* - Place the script at the root of your FTP. |
This file contains 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
(function(){ | |
function transitionEndEventName() { | |
var i, | |
el = document.createElement('div'), | |
transitions = { | |
'transition':'transitionend', | |
'OTransition':'otransitionend', // oTransitionEnd in very old Opera | |
'MozTransition':'transitionend', | |
'WebkitTransition':'webkitTransitionEnd' | |
}; |
This file contains 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
(function() { | |
$.fn.redraw = function(){ | |
$(this).each(function(){ | |
var redraw = this.offsetHeight; | |
}); | |
}; | |
})(); |
This file contains 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 | |
// https://github.com/tazotodua/useful-php-scripts | |
//optional: 5th parameter - backup specific tables only: array("mytable1","mytable2",...) | |
//optional: 6th parameter - backup filename | |
// NOTE! to adequatelly replace strings in DB, MUST READ: goo.gl/2fZDQL | |
function EXPORT_TABLES($host,$user,$pass,$name, $tables=false, $backup_name=false){ | |
set_time_limit(3000); $mysqli = new mysqli($host,$user,$pass,$name); $mysqli->select_db($name); $mysqli->query("SET NAMES 'utf8'"); | |
$queryTables = $mysqli->query('SHOW TABLES'); while($row = $queryTables->fetch_row()) { $target_tables[] = $row[0]; } if($tables !== false) { $target_tables = array_intersect( $target_tables, $tables); } | |
$content = "SET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";\r\nSET time_zone = \"+00:00\";\r\n\r\n\r\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\r\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\r\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\r\n/*!401 |
This file contains 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
<? | |
$mail = new PHPMailer; | |
// $mail->SMTPDebug = 3; Раскомментировать, чтобы увидеть отладочные сообщения | |
$mail->setFrom('[email protected]', 'Sender name'); | |
$mail->addAddress('[email protected]'); | |
$mail->Host = 'smtp.host.com'; | |
$mail->SMTPAuth = true; // Enable SMTP authentication | |
$mail->Username = 'usename'; // SMTP username | |
$mail->Password = 'password'; |
This file contains 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
const coordinateSystemForElementFromPoint = navigator.userAgent.match(/OS [1-4](?:_\d+)+ like Mac/) ? "page" : "client"; | |
let doc = document; | |
function onEvt(el, event, handler, context) { | |
if(context) { | |
handler = handler.bind(context); | |
} | |
el.addEventListener(event, handler); | |
return { | |
off: function() { | |
return el.removeEventListener(event, handler); |
This file contains 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
const fs = require('fs'); | |
fs.readFile('./sprite.svg', 'utf8', (err, data) => { | |
const regex = /<symbol id='([^']+)' viewBox='([^']+)'>(.*?)<\/symbol>/gs; | |
const outputDir = './icons'; | |
let match; | |
const matches = []; | |
while ((match = regex.exec(data)) !== null) { | |
const [symbol, name, viewBox, content] = match; |