Skip to content

Instantly share code, notes, and snippets.

View dimonchoo's full-sized avatar

Dmytro dimonchoo

  • Ukraine
View GitHub Profile
use Illuminate\Database\Capsule\Manager as DB;
DB::enableQueryLog();
DB::getQueryLog();
@dimonchoo
dimonchoo / slim-stream-route.php
Created August 15, 2022 06:44 — forked from james2doyle/slim-stream-route.php
Create a streaming download of a large file with Slim PHP using the build in Stream class
<?php
use Slim\Http\Request;
use Slim\Http\Response;
use Slim\Http\Stream;
$app->get('/stream', function (Request $request, Response $response, array $args) {
// a 100mb file
$path = '../public/files/document.pdf';
@dimonchoo
dimonchoo / NANO
Created May 13, 2022 09:16
NANO keyboard shortcuts.
CTRL+W \ F6 = search text in file
F1 = Show all shortcuts
@dimonchoo
dimonchoo / wp-secure.conf
Created May 19, 2021 08:21 — forked from ethanpil/wp-secure.conf
Wordpress Security for NginX
# wp-secure.conf
#
#
# This file includes common security considerations for wordpress using nginx.
#
# The goal is to block actions which are usually dangerous to wordpress.
# Additionally, we block direct access to PHP files and folders which should not
# be accessed directly from a browser.
#
# Also have included exceptions for plugins that are known to require this access.
[Unit]
Description=Translatons Queue Listen service
[Service]
Type=simple
User=root
WorkingDirectory=/var/www/html/wizards-translator
ExecStart=/usr/bin/php yii translate-queue/listen
TimeoutSec=300
@dimonchoo
dimonchoo / gist:447d212513d17a8913619c45b6e05d19
Created September 9, 2020 10:35
docker mysql dump restore
sudo docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE_NAME < localhost.sql
@dimonchoo
dimonchoo / button
Created August 28, 2020 21:58
Vacancies button
<center>
<a href='https://czholding.ru/rabota-v-chehii-vakansii/'>
<button style="width: 50x; height: 50px; background: #0b6e9a; color: #fff;">Поиск по вакансиям в Чехии ([vacancies_counter] вакансий)</button></a>
</center>
### Стандартный $PATH
/home/dimonchoo/.nvm/versions/node/v12.18.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
composer global require phpunit/phpunit
composer global require phpunit/dbunit
composer global require phing/phing
composer global require phpdocumentor/phpdocumentor
composer global require sebastian/phpcpd
composer global require phploc/phploc
docker exec -it [container-id] bash
find / -mount -type f -size +1G 2>/dev/null