Skip to content

Instantly share code, notes, and snippets.

kokes / cz.txt
Last active April 29, 2020 10:49
czech domains *potentially* affected by this CAA problem
View cz.txt
This file has been truncated, but you can view the full file.
hrach / dynamicReturnTypeMeta.json
Last active April 11, 2017 10:35
Dynamic Return Type
View dynamicReturnTypeMeta.json
"methodCalls": [
"class": "\\Mockery",
"method": "mock",
"position": 0,
"mask": "%s|\\Mockery\\MockInterface"
"class": "\\Nette\\DI\\Container",
hrach / nginx.conf
Created June 9, 2014 20:50
nginx + Nette framework rewrite
View nginx.conf
server {
listen 80;
root d:/webs/;
index index.php index.html;
try_files $uri $uri/ /index.php?$args;
location ~ \.phpt?$ {
try_files $uri @missing;
plentz / nginx.conf
Last active February 22, 2024 09:41
Best nginx configuration for improved security(and performance)
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
juzna /
Last active November 9, 2021 07:27
Server Configuration in git

Server Configuration in git

With git you can have anything versioned. You're used to version your code, which is a bunch of files. Your server configuration (on Linux) is also just a bunch of files, so it can be versioned as well.

The idea is simple: create a git repository in /etc/ and commit everytime you change any configuration of your server. Written in code:

cd /etc
git init
git add .
lyrixx / post-checkout
Created June 26, 2013 13:37
Git post checkout
View post-checkout
# Put this file at: .git/hooks/post-checkout
# and make it executable
# You can install it system wide too, see
Majkl578 / BufferedTextResponse.php
Created October 22, 2012 20:09
View BufferedTextResponse.php
namespace App\Application\Responses;
use Nette;
class BufferedTextResponse extends Nette\Application\Responses\TextResponse
public function send(Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse)
juzna / retina.js
Created October 12, 2012 22:47
Retina images quality simulator
View retina.js
* Simulates how normal low-res images look on retina display
* It resamples all images (within <img> tags) to a lower resolution.
* We should use half the resolution of original image to be precise (because retina has 2x the density of pixels),
* but that doesn't show * perceived* effect. It's enough to scale by 1.75.
* Also, it would be good to resample also images used in CSS background, but I dunno how to do it :/
* Requires jQuery
fprochazka / Nette Extension
Created October 5, 2012 09:45
Velocity template for PhpStorm & #nettefw
View Nette Extension
#set( $Class_prefix = ${NAME.substring(0, $NAME.indexOf('Extension'))} )
#set( $Extension_name = ${Class_prefix.toLowerCase()} )
#parse("PHP File Header.php")
namespace Kdyby\Extension\\${Class_prefix};
use Kdyby;
use Nette;
dg / gist:3644321
Created September 5, 2012 20:36
Texy on
View gist:3644321
* Texy parser for wiki page.
class Parser extends Nette\Object
* @return void