This file contains hidden or 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
## Container console commands (Windows: PowerShell) | |
# docker build --no-cache -t php:7.1 | |
# docker run --name test-php -v "${PWD}:/var/www:rw" -p "9001:9000" -d php:7.1 | |
# docker exec -ti php:7.1 /bin/sh | |
# docker rm test-php --force | |
# docker rmi php:7.1 | |
FROM alpine | |
RUN \ | |
addgroup -g 82 -S www-data && adduser -u 82 -D -S -G www-data www-data && \ |
This file contains hidden or 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
├── Africa | |
│ ├── Abidjan | |
│ ├── Accra | |
│ ├── Addis_Ababa | |
│ ├── Algiers | |
│ ├── Asmara | |
│ ├── Asmera | |
│ ├── Bamako | |
│ ├── Bangui | |
│ ├── Banjul |
This file contains hidden or 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
>>> Start test (1000 records) | |
Test time: 0.15334296226501 seconds, 0.37MB | |
Table: test | |
Rows: 1000 | |
Data_length: 0.02 MB | |
Index_length: 0.02 MB | |
Table: test_sha256 | |
Rows: 1000 | |
Data_length: 0.02 MB | |
Index_length: 0.02 MB |
This file contains hidden or 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 | |
class PmlMatchType implements \JsonSerializable | |
{ | |
const EXACT = 0b001; | |
const BROAD = 0b010; | |
const EXACT_COMBO = 0b100; | |
const EXACT_TEXT = 'Exact'; | |
const BROAD_TEXT = 'Broad'; |
This file contains hidden or 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 | |
$array = new SplFixedArray(2); | |
$array[0] = 'A'; | |
$array[1] = 'B'; | |
$offset = 0; | |
if ($array->offsetExists($offset)) { | |
$sizeNew = $array->getSize() - 1; | |
for ($i = $offset; $i < $sizeNew; ++$i) { | |
$array[$offset] = $array[$offset + 1]; | |
} |
This file contains hidden or 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 | |
$keywords = 'aa,bb,cc'; | |
function splitGenerator($haystack, $separator = ',') | |
{ | |
$separatorPos1 = -1; | |
while (true) { | |
$separatorPos2 = mb_strpos($haystack, $separator, $separatorPos1 + 1); | |
if (false === $separatorPos2) { | |
$chunk = mb_substr($haystack, - (mb_strlen($haystack) - $separatorPos1 - 1)); |
This file contains hidden or 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
/** | |
* @author Hryhorii Furletov <[email protected]> | |
* | |
* @example | |
* (new CommandReader).runYii('config/database').then((databaseConfig) => { }); | |
* (new CommandReader).runYii('/usr/bin/php', 'configJson.php').then((databaseConfig) => { }); | |
*/ | |
'use strict' | |
const spawn = require('child_process').spawn; |
This file contains hidden or 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
document.title = '[WS] Connected..'; | |
(function(){ | |
// config | |
var HOST = 'example.com' | |
var PORT = 3311 | |
var USER_ID = 1000; | |
// connect |
This file contains hidden or 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 | |
namespace app\rest; | |
use yii\filters\AccessControl; | |
use yii\filters\auth\CompositeAuth; | |
use app\components\HeaderParamAuth; | |
/** | |
* Description of ActiveController |
This file contains hidden or 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
СтоимостьКирпича = 2.5 // (грн) | |
ШиринаКирпича = 0.230 // (м) | |
ВысотаКирпича = 0.065 // (м) | |
ШиринаСтены = 12 // (м) | |
ВысотаСтены = 3 // (м) | |
КоличествоСтен = 4 // (шт) | |
КоличествоКирпичейНаСтену = (ШиринаСтены / ШиринаКирпича) * (ВысотаСтены / ВысотаКирпича) | |
ЦенаЗаСтену = КоличествоКирпичейНаСтену * СтоимостьКирпича | |
ЦенаЗаСтены = ЦенаЗаСтену * КоличествоСтен | |
Результат = "Для стен (" + КоличествоСтен + " шт) нужно кирпичей (" + КоличествоКирпичейНаСтену + " шт) по сумарной цене " + ЦенаЗаСтены + " грн." |