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
#include <cstdlib> | |
#include <cwchar> | |
#include <string> | |
#include <memory> | |
std::wstring to_wstring(const char* str) { | |
std::unique_ptr<wchar_t[]> tmp = nullptr; | |
size_t sz, len; | |
len = mbstowcs(nullptr, str, 0); | |
sz = len + 1; |
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
#include <iostream> | |
#include <locale> | |
#include <string> | |
#include <cstdint> | |
#include <limits> | |
static_assert(sizeof(char) == sizeof(uint8_t), "char != 8 bit"); | |
constexpr uint64_t make_cs(const char str[], std::size_t cnt, std::size_t n) noexcept { | |
return ( |
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
#include <functional> | |
#include <algorithm> | |
#include <iostream> | |
#include <utility> | |
#include <string> | |
#include <vector> | |
#include <assert.h> | |
template <class type> | |
using compare = std::function<bool(const type&, const type&)>; |
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
/* | |
build: g++ -std=c++11 pugi_test.cpp -o ptest -lpugixml | |
Used docs: | |
- (XPath select)[http://pugixml.org/docs/manual.html#xpath.select] | |
- (XPath examples)[https://msdn.microsoft.com/ru-ru/library/ms256086(v=vs.120).aspx] | |
*/ | |
#include <string> | |
#include <iostream> | |
#include <pugixml.hpp> |
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 | |
/** | |
* split utf-8 string to array of chars | |
* @param string $str | |
* @return array | |
*/ | |
function chars_of($str) { | |
return preg_split('/(?<!^)(?!$)/u', $str); | |
} |
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 | |
/** | |
* Функция-генератор для однообразного перебора загруженных файлов | |
* Системные требования | |
* PHP >= 5.5.0 | |
* @link http://php.net/manual/ru/language.generators.php | |
*/ | |
/** | |
* Генератор для однообразного перебора загруженных файлов |
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 | |
const DEBUG = true; | |
error_reporting(DEBUG ? E_ALL : 0); | |
ini_set('display_errors', DEBUG ? 'on' : 'off'); | |
set_error_handler(function($err_no, $err_str, $err_file, $err_line ) { | |
if (!(error_reporting() & $err_no)) { | |
return; |
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 | |
/** | |
* \cURLWrapper is helper class that allows to send GET/POST requests, upload files | |
* | |
* @package cURLWrapper | |
* @author Maxim 'Cra3y' | |
* @license LGPL | |
* @link https://gist.github.com/max-dark/4c08575bcff9d4c6ea926cd8c9813c01 | |
* | |
* Date: 12.07.16 |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Bootstrap 3 Modal Dialog Example</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- #include <jquery-1-12> --> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> | |
<!-- #include <jquery-1-12> --> | |
<!-- #include <bootstrap-3-3> --> |
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 | |
/* | |
________ | |
\___ _/ ___ _ __ ___ | |
.-. ,-, / / / _ \| .-\| / \ | |
\ \/ / _/ /__ | __/| | | | | | |
\__/ /______\\___||_| \___/ | |
______ _ ___ _ _ | |
/ _____\| |___ / _ \| || | | |
\_____ \| ,-. || __/| || | |
OlderNewer