Skip to content

Instantly share code, notes, and snippets.

View MikSDigital's full-sized avatar
🎯
Focusing

Mikhail MikSDigital

🎯
Focusing
View GitHub Profile
@MikSDigital
MikSDigital / composer.json
Created March 29, 2017 10:41 — forked from spekkionu/composer.json
Standalone validation using laravel validation component
{
"name": "spakkionu/validate",
"description": "Validation Test",
"require": {
"illuminate/validation": "~4.2.9"
},
"license": "MIT",
"authors": [
{
"name": "Jonathan Bernardi",
@MikSDigital
MikSDigital / contact.html.twig
Created March 30, 2017 15:22 — forked from michaelcullum/contact.html.twig
Contact Form for Silex
{% extends layout %}
{% block body %}
<div id="main">
<h2>Contact me</h2>
<p>For queries about anything on this website, or for job quotations, please contact me using the contact form below or via <a href="mailto:email@email.com">email</a>.</p>
<form action="#" method="post">
{{ form_start(form) }}
{{ form_errors(form) }}
@MikSDigital
MikSDigital / CSVImportCommand.php
Created April 27, 2017 15:32 — forked from zajca/CSVImportCommand.php
Symfony2 custom command for import CSV
<?php
namespace PRIA\QuizApiBundle\Command;
use PRIA\Bundle\UserBundle\EntityRepository\RoundsRepository;
use PRIA\QuizApiBundle\Entity\Answers;
use PRIA\QuizApiBundle\Entity\Questions;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
@MikSDigital
MikSDigital / .htaccess
Created July 16, 2017 15:06 — forked from Remiii/.htaccess
Symfony 2 redirect www to non-www with Apache .htaccess
# Use the front controller as index file. It serves as a fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
# start page (path "/") because otherwise Apache will apply the rewriting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex app.php
# Disabling MultiViews prevents unwanted negotiation, e.g. "/app" should not resolve
# to the front controller "/app.php" but be rewritten to "/app.php/app".
<IfModule mod_negotiation.c>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Which Browser?</title>
</head>
<body>
<p>You are using <span id="browser"></span> <span id="version"></span> on <span id="os"></span></p>
<script type="text/javascript" src="browserdetect.js"></script>
<script type="text/javascript">
@MikSDigital
MikSDigital / AppController.php
Created January 18, 2018 12:35 — forked from phpfour/AppController.php
Amazon S3 with Symfony2 and Gaufrette
<?php
namespace LM\Bundle\CoreBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class AppController extends Controller
{
@MikSDigital
MikSDigital / FormController.php
Created February 14, 2018 13:06 — forked from webdevilopers/FormController.php
Remove field type from symfony form using PRE_SET_DATA event
<?php
namespace Acme\AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Acme\AppBundle\Form\RemoveType;
@MikSDigital
MikSDigital / README.md
Created May 9, 2018 06:16 — forked from igormukhingmailcom/README.md
Symfony2 configuration for file uploads & cropping at EasyAdminBundle with JbFileUploaderBundle for multiple entities
<?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;
@MikSDigital
MikSDigital / User.php
Created July 6, 2018 18:31 — forked from Ocramius/User.php
Doctrine 2 ManyToMany - the correct way
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User