This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
class Bar | |
{ | |
public function getStuff() : int | |
{ | |
return 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function Loose(?array $foo) : ?array | |
{ | |
$localScoped = null; | |
if ($foo !== null) { | |
foreach ($foo as $bar) { | |
$localScoped[] = $bar->stuff(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface Price | |
{ | |
public function money(): Money; | |
public function currency(): Currency; | |
} | |
class Vat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\Form\Type | |
use AppBundle\Form\DataTransformer\ContactPersonLanguageModelTransformer; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
use Symfony\Component\OptionsResolver\OptionsResolver; | |
class AcmeType extends AbstractType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
access.format = "[%{%Y-%m-%dT%H:%M:%S%z}t] requestid:%{REQUEST_ID}e frontendip:%R frontendhost:%{SERVER_HOSTNAME}e host:%{HTTP_HOST}e clientip:%{REAL_IP}e https:%{HTTPS}e verb:%m response:%s fpm_pool:%n request:\"%{REQUEST_URI}e%Q%q\" script_filename:%f php_process_time:%{micro}d php_process_bytes:%{bytes}M php_cpu_user:%{user}C%% php_cpu_system:%{system}C%% php_cpu_total:%{total}C%%" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# +------------------------------------------------------------------+ | |
# | ____ _ _ __ __ _ __ | | |
# | / ___| |__ ___ ___| | __ | \/ | |/ / | | |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | | |
# | | |___| | | | __/ (__| < | | | | . \ | | |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | | |
# | | | |
# | Copyright Mathias Kettner 2014 [email protected] | | |
# +------------------------------------------------------------------+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Lunetics\AppBundle\Form\Response; | |
class FormInterceptor { | |
public function getFormErrorsToJson(Form $form) | |
{ | |
$errors = array(); | |
$translator = $this->get('translator'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$var= "123_456"; | |
$intval = intval($var); | |
$trim = trim($var); | |
var_dump($intval); // returns int(123) | |
var_dump($trim); // returns "123_456" | |
var_dump($intval == $trim); // true or false? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if ! [ -z "$*" ]; | |
then | |
separator="|"; | |
regex="$( printf "%s${separator}" "${@}" )"; | |
filter="-f \"${regex%?}\"" | |
fi; | |
echo ${filter}; | |
/usr/local/bin/sudo gstat -b -I 1s ${filter} | sed '1,2d' | awk -v host=${COLLECTD_HOSTNAME:=`hostname -f`} -v interval=${COLLECTD_INTERVAL:-10} '{ | |
print "PUTVAL " host "/iostat-" $10 "/iostat_tql" " interval=" interval " N:" $1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
regexp=[\d]{4}-[\d]{2}-[\d]{2} [\d]{2}:[\d]{2}\:[\d]{2} | |
colours=green | |
====== | |
regexp=[\w\d]+\.[\w\d]+: | |
colours=green bold | |
====== | |
regexp="[\w\d]+\.[\w\d+]+" | |
colours=on_green | |
====== | |
regexp= "[\w\d:\\ ]+"\. |