Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Filip Procházka fprochazka

🏠
Working from home
View GitHub Profile
View .gitconfig
[user]
name = Filip Procházka
email = filip@prochazka.su
signingkey = *PG KEY*
[init]
defaultBranch = master
[core]
whitespace = fix,-indent-with-non-tab,space-before-tab,trailing-space,cr-at-eol
View nette-https-behind-proxy.php
<?php
// hack for https proxies
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' && isset($_SERVER['SERVER_PORT']) && in_array($_SERVER['SERVER_PORT'], [80, 82])) { // https over proxy
$_SERVER['HTTPS'] = 'On';
$_SERVER['SERVER_PORT'] = 443;
} elseif ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'http' && isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 80) { // http over proxy
$_SERVER['HTTPS'] = 'Off';
@fprochazka
fprochazka / composer.php.ini
Last active Jun 14, 2022
Composer with different ini or with different PHP
View composer.php.ini
[php]
memory_limit = -1
max_execution_time = 0
date.timezone = "Europe/Prague"
realpath_cache_size = "4096K"
[opcache]
opcache.enable = 1
opcache.enable_cli = 1
opcache.memory_consumption = 256
View ssh2.class.php
<?php
if( !function_exists('mime_type_check') ){
function mime_type_check($path)
{
if( function_exists('mime_content_type') )
return mime_content_type($path);
else
return 'undefined/unknown';
}
@fprochazka
fprochazka / RadioListExtension.php
Created Aug 17, 2011
Nette Framework hack for getting controls and labels one by one
View RadioListExtension.php
<?php
namespace Kdyby\Forms;
use Nette;
use Nette\Forms\Controls\RadioList;
use Nette\Utils\Html;
use Nette\Utils\Arrays;
@fprochazka
fprochazka / main.js
Created Jul 4, 2011
Inicializace jQuery
View main.js
var init = function () {
// tělo funkce
};
if ($.browser.webkit) {
$(window).load(init);
} else {
$(document).ready(init);
}
@fprochazka
fprochazka / named.conf
Created Feb 17, 2012
Bind9 config files
View named.conf
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
View checkstyle.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<!--<property name="fileExtensions" value="java, xml, properties"/>-->
<module name="SuppressionFilter">
<property name="file" value="${checkstyle.config.path}/suppressions.xml"/>
</module>
@fprochazka
fprochazka / php-fpm
Created Feb 17, 2012
php-fpm config files & init.d script
View php-fpm
#!/bin/bash
### BEGIN INIT INFO
# Provides: php-fpm
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts php-fpm daemon
# Description: starts php-fpm daemon
@fprochazka
fprochazka / fastcgi.conf
Last active Apr 10, 2020
nginx config files
View fastcgi.conf
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;