Skip to content

Instantly share code, notes, and snippets.

View fprochazka's full-sized avatar
🏠
Working from home

Filip Procházka fprochazka

🏠
Working from home
View GitHub Profile
@fprochazka
fprochazka / .gitconfig
Last active December 15, 2023 17:44
.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
@fprochazka
fprochazka / php-fpm
Created February 17, 2012 12:11
php-fpm config files & init.d script
#!/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
<?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 June 14, 2022 15:09
Composer with different ini or with different PHP
[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
<?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 August 17, 2011 11:19
Nette Framework hack for getting controls and labels one by one
<?php
namespace Kdyby\Forms;
use Nette;
use Nette\Forms\Controls\RadioList;
use Nette\Utils\Html;
use Nette\Utils\Arrays;
@fprochazka
fprochazka / main.js
Created July 4, 2011 12:13
Inicializace jQuery
var init = function () {
// tělo funkce
};
if ($.browser.webkit) {
$(window).load(init);
} else {
$(document).ready(init);
}
@fprochazka
fprochazka / named.conf
Created February 17, 2012 15:15
Bind9 config files
// 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";
@fprochazka
fprochazka / checkstyle.xml
Created February 13, 2017 22:44
Java coding style
<?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 / fastcgi.conf
Last active April 10, 2020 03:07
nginx config files
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;