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
@spolischook
spolischook / gist:6d2f6596d799eca524bef2ee060f2fe7
Last active October 28, 2017 23:28 — forked from ahonymous/HW2.md
HW Symfony start

HW2

  1. Поставити Symfony і створити репозиторій на github (чиста сімфа з моделями в гілці master)
  2. Створити під кожну модель, з попереднього домашнього завдання, CRUD контролери
  3. Описати для кожного контролера роутинг у окремому yml файлі, які мають бути в тому ж AppBundle, що і контроллери
  4. Для кожного контролера створити Twig-темплейт, який має знахоитиися в тому ж AppBundle, що і контролери
  5. Для кожного контролера написати функціональний тесь, який перевіряє, що контролер віддає 200

Acceptance:

  1. При виконанні роботи потрібно дотримуватися GIT FLOW, PSR і Symfony Code Styles:
  • Кожен ПР (якщо їх буде > 1) має бути заапрувлений одним із викладачів перед тим як буде вмержений в master бранч
@spolischook
spolischook / BrowserContext.php
Created July 28, 2016 12:37 — forked from fabiang/BrowserContext.php
Mink + PhantomJS catch JavaScript Errors
<?php
use Behat\MinkExtension\Context\MinkContext;
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
/**
* Defines application features from the specific context.
public function findByDateRangeAndSlug(\DateTime $fromDate, \DateTime $toDate, $performanceSlug = null)
{
$qb = $this->createQueryBuilder('u')
->WHERE('u.dateTime BETWEEN :from AND :to')
->setParameter('from', $fromDate->format('Y-m-d H:i'))
->setParameter('to', $toDate->format('Y-m-d H:i'))
->orderBy('u.dateTime', 'ASC')
;
if ($performanceSlug) {
<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
fos_js_routing:
routes_to_expose:
- "^api_.*" # expose all routes with a name starting with api_