Skip to content

Instantly share code, notes, and snippets.

View kumirska's full-sized avatar

kumirska kumirska

View GitHub Profile
<?php
namespace AppBundle\Helpers;
/**
* Example
* Add to property's phpdoc `* RegexPattern(pattern="/[^\\]+/s", message="Unsupported symbol")`
*/
trait ObjectFieldsValidationTrait
{
server {
server_name xhprof.local;
root /var/www/xhprof-0.9.4/xhprof_html;
index index.php;
access_log off;
error_log /var/www/xhprof-0.9.4/log/nginx.error.log;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm-xhprof.sock;
server {
server_name redisadmin.local;
root /var/www/redisadmin;
index index.php;
# access_log off;
error_log /var/www/redisadmin/log/nginx.error.log;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm-redisadmin.sock;
@kumirska
kumirska / StrToInt.php
Last active May 25, 2018 14:10
String to int encoder, decoder
<?
protected function strToInt($string) {
$unpacked = unpack('C*', $string);
return join(
array_map(function ($n) {return sprintf('%03d', $n);}, $unpacked)
);
}
protected function intToStr($number) {