Skip to content

Instantly share code, notes, and snippets.

View cornobils's full-sized avatar

Dmitrijs Čornobiļs cornobils

View GitHub Profile
@jakzal
jakzal / bin > drun
Last active March 31, 2020 08:29
Docker with Symfony, RabbitMQ, Nginx
#!/bin/bash
set -e
set -u
set -o pipefail
COMMAND=${1:-"help"}
MACHINE_NAME=myapp
DENV=${DENV:-"dev"}
@alexander-schranz
alexander-schranz / SuluExtendController.php
Last active December 29, 2021 15:19
Custom sulu controller which load some data from a service
<?php
namespace App\Controller\Website;
use Sulu\Bundle\WebsiteBundle\Controller\WebsiteController;
use Sulu\Component\Content\Compat\StructureInterface;
/**
* Controller which needs a custom service to add data to render twig template.
*/
@chadrien
chadrien / README.md
Last active September 1, 2023 12:43
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&amp;&amp; echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" &gt; /usr/local/etc/php/conf.d/xdebug.ini \
@jshcrowthe
jshcrowthe / installing-oh-my-zsh-fedora.md
Last active December 8, 2022 18:38
Installing Oh My ZSH oh Fedora (2015 CIT 325 Image)

Installing oh-my-zsh on Fedora (for DB class images)

Oh-my-zsh is an extension of the traditional z shell that is extensible via community created plugins (Plugins found here: oh-my-zsh github repo). It is, in my opinion, a breath of fresh air in comparison to the traditional bash shell.

DO THE FOLLOWING IN ORDER

Installing ZSH (using yum)

The first step for this install is getting zsh we will do this via yum. From your terminal:

# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@webdevilopers
webdevilopers / ContractController.php
Last active March 11, 2020 09:00
Symfony Event Listener to send html mail using SwiftMailer and Twig
<?php
namespace Acme\Bundle\ContractBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class ContractController extends Controller
{
public function eventAction(Contract $contract)
{
$event = new ContractEvent($contract);
anonymous
anonymous / gist:f09b5cd487b5ad55c46e
Created January 13, 2015 19:52
Enhanced isScrolledIntoView
$.fn.isInViewport = function(containerSelector, partial) {
var $element = this;
if($element.length) {
var el = $element[0];
var rect = el.getBoundingClientRect();
if(containerSelector && $(containerSelector).length) {
var parentRect = $(containerSelector)[0].getBoundingClientRect();
} else {
@euskadi31
euskadi31 / ExceptionController.php
Last active May 29, 2017 09:17
Add translation support of error page in Symfony2
<?php
namespace Acme\Bundle\FrontBundle\Controller;
use Symfony\Bundle\TwigBundle\Controller\ExceptionController AS Controller;
use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference;
use Symfony\Component\HttpFoundation\Request;
class ExceptionController extends Controller
{
<?php
namespace NoxLogic\DemoBundle\Form\Type;
use Doctrine\ORM\EntityManager;
use NoxLogic\DemoBundle\Entity\Province;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
@marvell
marvell / bitrix_server_settings.md
Created February 5, 2014 15:14
Bitrix: рекомендации по настройке сервера

Bitrix: рекомендации по настройке сервера

Двухуровневая структура web-сервера: nginx + apache2. PHP должен быть работать через apache-модуль. Настройки должны быть одинковыми как для apache-модуля, так и для cli.

Структура директорий

/var/www/example.com [root:root 0755]
/var/www/example.com/logs/ [www-data:www-data 0755]
/var/www/example.com/public/ [www-data:webdev 0775]