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 | |
/** | |
* bumbom.php | |
* @link https://gist.github.com/max-dark/01d2bc7c54fa2f161d54add970763807 | |
* | |
* Утилита для пакетного удаления BOM | |
* Использование: | |
* 0 создать бекап всех файлов | |
* 1 Закинуть в папку с файлами | |
* 2 поправить(если надо) $ext_list |
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> | |
using namespace std; | |
template < | |
class T | |
> | |
/** | |
* @brief The Class struct | |
* | |
* Создает алиас 'parent' для родительского класса T | |
* Позволяет обращаться к методам родительского класса parent::methodName() |
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
/** | |
* Simple XMLHttpRequest wrapper | |
* | |
* @constructor | |
* @this {Ajax} | |
*/ | |
var Ajax = function () { | |
/** | |
* @type {XMLHttpRequest} | |
*/ |
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 | |
/** | |
* @copyright Copyright (C) 2016 Max Dark maxim.dark@gmail.com | |
* @license MIT; see LICENSE.txt | |
*/ | |
namespace Tools{ | |
/** | |
* Class 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
#include <unistd.h> | |
//... | |
ssize_t buf_size = ...; | |
char * buffer = (char *) malloc(buf_size); | |
//.... | |
ssize_t read_count = 0; | |
int file_in; | |
file_in = open(...); |
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
// https://en.wikipedia.org/wiki/Visitor_pattern | |
#include <iostream> | |
#include <memory> | |
class A; | |
class B; | |
class C; | |
struct Visitor | |
{ |
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 | |
/** | |
* @file https://gist.github.com/max-dark/f39028cc106ed32e8ce1b55a11643b43 | |
*/ | |
define('ROOT_NODE', null); | |
/** | |
* восстанавливает дерево по таблице связей | |
* @param array $data |
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 <iomanip> | |
struct point_t | |
{ | |
using coord_t = int; | |
coord_t x; | |
coord_t y; | |
}; |
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
// task: create two queues that will be located in one array of a fixed size | |
// solution: create a pool of blocks in this array. | |
// http://www.cyberforum.ru/algorithms/thread2569313.html | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
#include <assert.h> | |
// настройки типов |
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
// task: https://en.wikipedia.org/wiki/Fizz_buzz | |
// compile: g++ -std=c++14 -Wall -Wpedantic -Werror fizz_buzz.cxx -o fizz_buzz | |
#include <iostream> | |
#include <string> | |
namespace | |
{ | |
std::string solve(int num); | |
} | |
int main() |