Skip to content

Instantly share code, notes, and snippets.

View olekhy's full-sized avatar
🤓
happy developer

Alexander Hutorezki olekhy

🤓
happy developer
View GitHub Profile
<?php
,
'form_collection_view_helpers' => [
'sales_channels' => [
'collection_template' => false,
'element_render_config' => [
'DimabayApp\Form\SalesChannelFieldset:type' => [
'helper' => [
'name' => 'formBlock',
<?php
namespace Application\View\Helper;
use RuntimeException;
use SpiffyNavigation\Page\Page;
use SpiffyNavigation\View\Helper\AbstractHelper;
class Breadcrumbs extends AbstractHelper
{
#https://gorails.com/setup/ubuntu/14.04
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.2
rvm use 2.1.2 --default
@olekhy
olekhy / gist:e0735a82449436db5c8e
Created September 16, 2014 12:57
perfomance testing for generation unique id from string smaller than 1000 chars
I've take an simple test for get sure what is the best basic case for this
Firstly my timing result:
```shell
% (php /tmp/testmd5.php); (php /tmp/testsha1.php); (php /tmp/teststr_replace.php); (php /tmp/teststrtr.php);
11.715120792389( php /tmp/testmd5.php; ) 11,73s user 0,01s system 99% cpu 11,750 total
13.626849889755( php /tmp/testsha1.php; ) 13,65s user 0,00s system 99% cpu 13,653 total
16.591732978821( php /tmp/teststr_replace.php; ) 16,60s user 0,02s system 99% cpu 16,627 total
87.248502969742( php /tmp/teststrtr.php; ) 87,24s user 0,01s system 99% cpu 1:27,28 total
@olekhy
olekhy / loader.php
Last active August 29, 2015 14:02
services loader w/o instanciate via NEW keyword
<?php
abstract class AbstractService
{
protected $options;
final protected function __construct($options)
{
$this->options = $options;
}
This file has been truncated, but you can view the full file.
INFO global: Vagrant version: 1.4.1
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_BOX_ENVIRONMENT="external"
INFO global: VAGRANT_DETECTED_OS="Linux"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_LOG="debug"
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/communicators/ssh/plugin.rb
@olekhy
olekhy / vagrant.provision.debug.log
Created May 21, 2014 22:44
vagrant.provision.debug.log
This file has been truncated, but you can view the full file.
INFO global: Vagrant version: 1.4.1
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_BOX_ENVIRONMENT="external"
INFO global: VAGRANT_DETECTED_OS="Linux"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_LOG="debug"
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/communicators/ssh/plugin.rb
<?php
/**
* This file is part of me
*
* @author Oleksandr Khutoretskyy <olekhy@gmail.com>
* Date: 9/9/13
* Time: 11:30 PM
* @license MIT
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS

Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should consider using (and some other shiny extras).

public class WhoMayUsePrivate
{
public static void main( String[] args )
{
DiskoVergleicher m = new DiskoVergleicher();
System.out.println( m.compare( new DiskoVergleicher() ) );
}
}
class DiskoVergleicher
{