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- / 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 }
@Nek-
Nek- / composer.json
Last active August 29, 2015 14:10
Goutte via composer
{
"require": {
"fabpot/goutte": "2.0.2"
}
}
<?php
$builder->add('selectedFile', 'hidden', [
'constraints' => [
new NotBlank(),
new Type(['type' => 'integer', 'message' => 'Their was a failure on the internet.'])
]
]);
@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>

Récap sur le iceframework et les tools qui vont autour

ICE est le protocole de synchronisation utilisé par WebRTC (en VoIP). ( https://www.wikiwand.com/en/Interactive_Connectivity_Establishment ) Il est associé aux protocoles stun et turn.

L’objet RtcPeerConnection a besoin d’un objet RTCConfiguration qui se configure en spécifiant un (ou plusieurs) serveur stun/turn.

L’outil suivant permet de monter un serveur stun & turn : https://github.com/coturn/coturn (une image coturn est dispo sur AWS apparemment)

<?php
namespace ServicePlus\CoreBundle\Service;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityNotFoundException;
use ServicePlus\CoreBundle\Entity\Company;
use ServicePlus\CoreBundle\Entity\Device;
use ServicePlus\CoreBundle\Entity\Report;
use Symfony\Component\EventDispatcher\EventDispatcher;
@Nek-
Nek- / gist:2639467
Created May 8, 2012 21:28
probable fix doctrine utf-8 columns (but fails)
dbal:
default_connection: default
connections:
default:
charset: utf8
CREATE TABLE IF NOT EXISTS `address` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(255) NOT NULL,
`lastname` varchar(255) NOT NULL,
`street` varchar(255) NOT NULL,
`city` varchar(255) NOT NULL,
`postcode` varchar(255) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
<?php
/**
* Classe totalement inutile
*/
class Useless
{
/**
* Fait une multiplication toute conne
*
CREATE TABLE `Article` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`title` varchar(255) NOT NULL,
`subTitle` varchar(255) DEFAULT NULL,
`content` longtext NOT NULL,
`slug` varchar(255) NOT NULL,
`lang` varchar(10) NOT NULL,
`createdAt` datetime NOT NULL,
`updatedAt` datetime DEFAULT NULL,