Skip to content

Instantly share code, notes, and snippets.

View belocer's full-sized avatar
💭
My blog. good-code.ru

Денис Белоцерковец belocer

💭
My blog. good-code.ru
View GitHub Profile
@belocer
belocer / README.md
Last active September 25, 2021 11:27
gulpfile

gulp4 / Landing Page / WordPress

Собрать сборку

gulp build

Запустить

gulp

<?php
// Подключение к БД
$pdo = new PDO("mysql:host=localhost: dbname=test", "root", "");
// Готовим запрос
$sql = "SELECT * FROM tasks";
$statement = $pdo->prepare($sql); // подготовить запрос
$result = $statement->execute(); // вернет true || false // Запускает подготовленный запрос на выполнение
@belocer
belocer / WaterMark.php
Created October 31, 2018 13:08
WaterMark + PHP + GD
/* WaterMark Водный знак */
// Сообщаем браузеру что ему даем картинку
header('Content-Type: image/jpeg'); // Работает для jpeg
$dir = __DIR__ . "/images/";
$arr_name_img = scandir($dir);
array_shift($arr_name_img); // Удалил .
array_shift($arr_name_img); // Удалил ..
@belocer
belocer / Work File System .txt PHP
Created January 26, 2019 14:56
Work File System .txt PHP
<?php
$dir = scandir("source");
$file = [];
for ($i = 2; $i < count($dir); $i++) {
$_arr = fopen("source/" .$dir[$i], "r");
array_push($file, file("source/" .$dir[$i]));
}
$arr = [];
$arr = call_user_func_array('array_merge', $file);
@belocer
belocer / index.html
Created May 18, 2019 05:37
Text Mask, Comic effect using blend modes
<h1>Kaboom</h1>
@belocer
belocer / index.html
Created May 21, 2019 05:42
EventSource Comet
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<ul id="chat">
</ul>
@belocer
belocer / autoload.php
Created July 1, 2019 08:48
AutoLoad Classes
<?php
spl_autoload_register(function ($ClassName){
$filePath = 'classes/' . $ClassName;
if (file_exists($filePath)) {
require_once $filePath;
}
});
spl_autoload_register(function ($ClassName){
$filePath = 'controller/' . $ClassName;
@belocer
belocer / .gitignore Laravel
Last active July 28, 2019 09:59
Laravel webpack.mix.js
/node_modules
/public/hot
/public/build
/public/storage
/storage/*.key
/vendor
.env
.phpunit.result.cache
Homestead.json
Homestead.yaml
@belocer
belocer / index.html
Last active September 11, 2019 10:06
Класс для работы со звездами на сайте.
<!-- HTML для класса -->
<span class="rating nowrap" id="stars3">
<i class="empty star" data-qty-star="1"></i>
<i class="empty star" data-qty-star="2"></i>
<i class="empty star" data-qty-star="3"></i>
<i class="empty star" data-qty-star="4"></i>
<i class="empty star" data-qty-star="5"></i>
<label for="stars_input3"></label>
<input type="text" name="star_rait_speed" id="stars_input3" value="0" class="review-qty" readonly>
</span>
@belocer
belocer / console.log.js
Created September 13, 2019 11:10
Узнать количество тегов на странице
var all = document.getElementsByTagName("*");
console.log( all.length );