Skip to content

Instantly share code, notes, and snippets.

View spolischook's full-sized avatar
🌐
Saving the world

Serhii Polishchuk spolischook

🌐
Saving the world
View GitHub Profile
{
"_index": "exercise_joybauer",
"_type": "recipe",
"_id": "119",
"_score": 10.57531,
"_source": {
"title": "Italian Ranch Turkey Burger",
"description": "This zesty, low-cal ranch burger was created by Joy Fit Club member Clint Lehman. The melty pockets of feta cheese really put it over the top!",
"categories": [{
"title": "Type 2 Diabetes"
;xDebug Configuration starts
zend_extension=/usr/lib/php5/20121212/xdebug.so
xdebug.max_nesting_level=250
xdebug.var_display_max_depth=10
xdebug.remote_enable=true
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.remote_host=127.0.0.1
xdebug.idekey=phpstorm-xdebug
sudo su
apt-get install apache2
apt-get install php5 libapache2-mod-php5
apt-get install mysql-server mysql-client
apt-get install phpmyadmin
service apache2 restart
apt-get install php5-mysql php5-curl php5-gd php5-intl php5-imagick php5-imap php5-mcrypt php5-memcache php5-xdebug php-apc php5-dev
apt-get install git-core
apt-get install curl
http://design-pattern.ru/patterns/data-mapper.html - Doctrine2
https://ru.wikipedia.org/wiki/ActiveRecord - Propel, Laravel, Yii, Yii2
Data Fixtures
http://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html
https://github.com/hautelook/AliceBundle
@spolischook
spolischook / kotoblog_54674cf6684b7.php
Last active August 29, 2015 14:09
This code check if exists some static method in parent class and call it if true
<?php
class ParentParentClass
{
public static function test()
{
echo 'ParentParent::test call';
}
}
<?php
namespace Geekhub\UserBundle\Tests\UserProvider;
use Geekhub\UserBundle\Entity\User;
use Geekhub\UserBundle\UserProvider\FacebookProvider;
use HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse;
class FacebookProviderTest extends \PHPUnit_Framework_TestCase
{

11.11.2014 Symfony overview, Controller, Routing, Twig

  • Install Symfony standart edition
  • Symfony Bundles
  • Symfony Components
  • Create Bundle, route and controller
  • Add twig view

18.11.2014 Databases and Doctrine

<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
<?php
if (is_cli()) {
echo "********************************\n";
echo "* *\n";
echo "* Symfony requirements check *\n";
echo "* *\n";
echo "********************************\n\n";
echo sprintf("php.ini used by PHP: %s\n\n", get_ini_path());
@spolischook
spolischook / importdb.php
Last active August 29, 2015 14:06
Batch script for import mongo dump
#!/usr/bin/env php
<?php
require_once __DIR__.'/base_script.php';
$options = getopt("", array('db:', 'dir:'));
$options['dir'] = !empty($options['dir']) ? $options['dir'] : "/";
$options['db'] = !empty($options['db']) ? $options['db']: "exercise";
$optionsLine = sprintf(" --dir=%s --db=%s", $options['dir'], $options['db']);