Skip to content

Instantly share code, notes, and snippets.

View Nek-'s full-sized avatar
:octocat:

Maxime Veber Nek-

:octocat:
View GitHub Profile
@Nek-
Nek- / layout.go
Created March 10, 2015 14:33
Templating in Go
<!DOCTYPE HTML>
<html>
<head>
<title>{{.Title}}</title>
<meta charset="UTF-8" />
</head>
<body>
<div id="content">
{{template "content" .}}
</div>
<?php
$builder->add('selectedFile', 'hidden', [
'constraints' => [
new NotBlank(),
new Type(['type' => 'integer', 'message' => 'Their was a failure on the internet.'])
]
]);
@Nek-
Nek- / composer.json
Last active August 29, 2015 14:10
Goutte via composer
{
"require": {
"fabpot/goutte": "2.0.2"
}
}
@Nek-
Nek- / services.yml
Created September 1, 2014 08:26
Using the shuffle extension of twig in symfony
services:
twig.extension.array:
class: Twig_Extensions_Extension_Array
tags:
- { name: twig.extension }
<?php
namespace Ceva\CoreBundle\Listener;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Cookie;
@Nek-
Nek- / Instructions.md
Last active January 4, 2016 21:09
Vote Nekland Admin Bundle Configuration

Hello, I'm making an admin bundle and searching for the best logical and easiest configuration.

The bundle i'm working on will generate a dashboard and cruds with only the following configuration. Here are two approach and I don't know which one is the best.

Please help me :-) . Vote in comments !

<?php
$base = array('foo' => array('bar' => array('foobar' => 'magicbox')));
$str = 'foo.bar.foobar';
$final = $base;
foreach (explode('.', $str) as $e) $final = $final[$e];
echo $final;
http://screencloud.net/v/sZh1
@Nek-
Nek- / gist:7625843
Last active December 29, 2015 05:59 — forked from anonymous/gist:7625794
<?php
public function createAction(Request $request, $package_id)
{
$package = $this->getPackage($package_id);
$entity = new Prestation();
$entity->setPackage($package);
$form = $this->createCreateForm($entity);
$form->handleRequest($request);
<?php
/**
* Author: nek
* Date: 29/08/13
* Copyleft Nekland
*/
namespace Nekland\Bundle\BaseAdminBundle\Form\Type;
use Symfony\Component\Form\AbstractType;