Skip to content

Instantly share code, notes, and snippets.

milo / LatteBackportMacros.php
Created Feb 14, 2020
Latte 2.7 macros bacported for Latte 2.6
View LatteBackportMacros.php
* I'm excited from PhpStorm Latte plugin update and support of new {varType} and {templateType} macros prepared for
* a new Latte 2.7 release. But I'm still using Latte 2.6. This class is a temporary backport of this macros before
* I upgrade to 2.7.
* About plugin updates:
milo /
Last active Jun 14, 2022
Oracle OCI8 extension on Linux Debian

Oracle Instant Client libraries installation

Download Oracle Instant Client libraries (URL may change, already happened few times). Be sure you download correct (x64 or x32) architecture. And correct version.

Last time I used Client with Oracle 12c and PHP 8.1.

Before that Instant Client with Oracle 12c and compiled with PHP 8.0, 7.4 and 7.3 fine.

Before that Instant Client with Oracle 10g, 11g and 12c and PHP 5.6, 7.1, 7.2, 7.3 and 7.4.

Never hit any problem with such setups but my queries are quite simple. One should be fine with the newest version. It should be backward compatible (fingers crossed).

milo / ServiceCollectionsExtension.php
Created Oct 3, 2018
Nette DI service collections
View ServiceCollectionsExtension.php
namespace App;
use Nette\DI\CompilerExtension;
milo / CsvResponse.php
Last active Jun 25, 2018
CSV response for Nette Application
View CsvResponse.php
namespace App\Responses;
use Nette\Application;
use Nette\Http;
milo / vhost.conf
Created Nov 22, 2017
Apache proxy to localhost port with WebSockets
View vhost.conf
# Proxy for local running .NET application on port 5000
# a2enmod proxy proxy_http proxy_wstunnel
<VirtualHost *:443>
milo / Crypt.php
Last active Jan 28, 2019
Crypt with OpenSSL
View Crypt.php
* Copyright (c) 2015 Miloslav Hůla (
namespace Milo;
final class Crypt
milo / fid-remove.js
Created Apr 20, 2017
Flash message _fid parameter remove.
View fid-remove.js
(function (w, timeout) {
setTimeout(function () {
var url = w.location.toString();
if (w.history && w.history.replaceState && url.indexOf('_fid=') !== -1) {
w.history.replaceState({}, null, /[?&]_fid=[^&]+$/.test(url)
? url.replace(/[?&]_fid=[^&]+/, '')
: url.replace(/([?&])_fid=[^&]+&/, '$1')
}, timeout || 2000);
milo / PersistentUploadControl.php
Created Aug 18, 2015
Persistent file upload control for #nettefw
View PersistentUploadControl.php
namespace App\Controls;
use App\Model\Entities;
use Nette\DirectoryNotFoundException;
use Nette\Forms;
use Nette\Http;
use Nette\Utils\Html;
milo / post-merge
Created Jul 23, 2015
Git hook for purging cache
View post-merge
# Save as .git/hooks/post-merge
# Set execute bit like: chmod ug+x .git/hooks/post-merge
echo -n "HOOK [Purge cache]: "
if [ -d "$purgePath" ]; then
milo / Bootstrap3Renderer.php
Created Jun 3, 2015
Bootstrap3 renderer for Nette Framework forms
View Bootstrap3Renderer.php
namespace Milo\NetteForms\Rendering;
use Nette\Forms;
use Nette\Forms\Controls;
* Simple Bootstrap3 renderer for Nette Framework forms.