Skip to content

Instantly share code, notes, and snippets.

View qRoC's full-sized avatar
🇺🇦
Defending my home

Andrii Savytskyi qRoC

🇺🇦
Defending my home
View GitHub Profile
@qRoC
qRoC / results
Last active January 24, 2017 15:32 — forked from dongilbert/results
Benchmark newInstanceWithoutConstructor vs unserialize for object creation vs json
PHP 5.6.29:
ReflectionClass::newInstanceWithoutConstructor: 0.17457699775696
ReflectionClass::newInstanceWithoutConstructor(json): 0.11926913261414
unserialize: 0.21122980117798
PHP 7.1.0:
ReflectionClass::newInstanceWithoutConstructor: 0.066795110702515
ReflectionClass::newInstanceWithoutConstructor(json): 0.065139055252075
unserialize: 0.10229301452637
@qRoC
qRoC / ORMFixture.php
Last active June 18, 2016 18:38
DoctrineFixturesBundle for big data
<?php
// Copyright (c) 2016 Andrey <qRoC.Work@gmail.com> Savitsky. All rights reserved.
// Site: http://qRoC.pro
namespace CommonBundle\DataFixtures;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
@qRoC
qRoC / list.sh
Last active April 12, 2016 21:58
DL380 G4 DEBIAN Jessie
vim /etc/apt/sources.list
> deb http://httpredir.debian.org/debian/ jessie main contrib non-free
apt-get update
apt-get install lib32stdc++6 binutils firmware-linux-nonfree
wget http://debian.sevstar.net/hp/pool/non-free/hp-health_8.7.0.1.2-5_amd64.deb
dpkg -i hp-health_8.7.0.1.2-5_amd64.deb
wget http://debian.sevstar.net/hp/pool/non-free/cpqacuxe_8.70-9.0.7-8_amd64.deb
dpkg -i cpqacuxe_8.70-9.0.7-8_amd64.deb
wget http://debian.sevstar.net/hp/pool/non-free/hp-snmp-agents_8.7.0.1.7-9_amd64.deb
mkdir tmp
DEBIAN 8 Настройка сервера
==========================
Генерация ключей доступа
------------------------
$ cd ~/.ssh
$ ssh-keygen -t rsa
> KEY_NAME
> PASSPHRASE
$ ssh-keygen -R [SERVER_IP]
@qRoC
qRoC / extensions.sh
Last active March 7, 2016 12:54
php 7.0.2 debian
printf "\n" | pecl install apcu-beta && echo extension=apcu.so > /usr/local/etc/php/conf.d/10-apcu.ini
printf "\n" | pecl install apcu_bc-beta && echo extension=apc.so > /usr/local/etc/php/conf.d/apc.ini
printf "\n" | pecl install channel://pecl.php.net/amqp-1.7.0alpha2 && echo extension=amqp.so > /usr/local/etc/php/conf.d/amqp.ini
pecl install channel://pecl.php.net/ev-1.0.0RC9 && echo extension=ev.so > /usr/local/etc/php/conf.d/ev.ini
cd /etc && git clone --depth=1 -b php7 https://github.com/phpredis/phpredis.git \
&& cd /etc/phpredis \
&& phpize \
@qRoC
qRoC / main.cpp
Last active February 19, 2018 10:36
GO compiler
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include <sys/time.h>
#include <stdint.h>
typedef int64_t TimeVal;
@qRoC
qRoC / result.txt
Created November 19, 2015 16:26
& vs new
BenchmarkNewV1Arr-8 2000000000 1.86 ns/op
BenchmarkNewV1Struct-8 1000000000 2.04 ns/op
BenchmarkNewV2Arr-8 1000000000 3.18 ns/op
BenchmarkNewV2Struct-8 500000000 3.24 ns/op