Skip to content

Instantly share code, notes, and snippets.

View dimonchoo's full-sized avatar

Dmytro dimonchoo

  • Ukraine
View GitHub Profile
@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 / 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.