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 | |
// get latest german WordPress file | |
$ch = curl_init(); | |
$source = "https://de.wordpress.org/latest-de_DE.zip"; | |
curl_setopt($ch, CURLOPT_URL, $source); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$data = curl_exec ($ch); | |
curl_close ($ch); |
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
#Правило обрабатывает внутренние страницы | |
# http://site.ru/catalog////item/// | |
RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$ | |
#Проверяем, повторяется ли слеш (//) более двух раз. | |
RewriteRule . %1/%2 [R=301,L] | |
#Исключаем все лишние слеши. | |
#удаляем слеши для главной http://site.ru///// | |
RewriteCond %{THE_REQUEST} ([^\s]*)\/{2,}(\?[^\s]*)? | |
RewriteRule (.*) / [R=301,L] |
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
// Cartesian product of arrays | |
// @takes N arrays -- arguments *must* be arrays | |
// @returns an array of X arrays of N elements, X being the product of the input arrays' lengths. | |
function cartesianProduct(...arrays) { | |
function _inner(...args) { | |
if (arguments.length > 1) { | |
let arr2 = args.pop(); // arr of arrs of elems | |
let arr1 = args.pop(); // arr of elems | |
return _inner(...args, |
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
# ---------------------------------------------------------------------- | |
# | Komprimierung und Caching | | |
# ---------------------------------------------------------------------- | |
# Serve resources with far-future expires headers. | |
# | |
# (!) If you don't control versioning with filename-based | |
# cache busting, you should consider lowering the cache times | |
# to something like one week. | |
# |
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 custom_mail($to, $subject, $message, $additional_headers, $additional_parameters){ | |
//Получаем тему письма | |
$elements = imap_mime_header_decode($subject); | |
$title = ''; | |
for ($i=0; $i<count($elements); $i++) { | |
$title .= $elements[$i]->text; | |
} | |
//В файле PHPMailerAutoload.php на строке 24 |
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
Bootstrap 3 - Carousel/Slider Collection | |
Article: http://sevenx.de/blog | |
Demo: http://sevenx.de/demo/bootstrap-carousel | |
Working Examples (inline Styles, CDN Scripts) | |
- minimal Bootstrap Markup changes | |
- minimal CSS Styles | |
- minimal jQuery |
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
/** | |
* Create a web friendly URL slug from a string. | |
* | |
* Requires XRegExp (http://xregexp.com) with unicode add-ons for UTF-8 support. | |
* | |
* Although supported, transliteration is discouraged because | |
* 1) most web browsers support UTF-8 characters in URLs | |
* 2) transliteration causes a loss of information | |
* | |
* @author Sean Murphy <sean@iamseanmurphy.com> |