Skip to content

Instantly share code, notes, and snippets.

View romainneutron's full-sized avatar

Romain Neutron romainneutron

View GitHub Profile

Keybase proof

I hereby claim:

  • I am romainneutron on github.
  • I am romainneutron (https://keybase.io/romainneutron) on keybase.
  • I have a public key whose fingerprint is 1F0A B6EA FD62 362E A74A 06C7 85F0 4906 7ABF 4762

To claim this, I am signing this object:

@romainneutron
romainneutron / run.php
Last active March 14, 2018 19:07 — forked from lyrixx/run.php
Slack delete all your files (rewrite of https://gist.github.com/jamescmartinez/909401b19c0f779fc9c1)
<?php
<<<CONFIG
packages:
- "kriswallsmith/buzz: ^0.15.0"
- "symfony/console: ^3.2@dev"
CONFIG;
// Find you token on https://api.slack.com/docs/oauth-test-tokens
use Buzz\Message\Response;
<?php
use Symfony\Component\HttpFoundation\Request;
$loader = require __DIR__.'/../app/autoload.php';
include_once __DIR__.'/../app/bootstrap.php.cache';
$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
@romainneutron
romainneutron / gist:9544313
Last active August 29, 2015 13:57
Feedback about Symfony/Process on Windows

Hi everybody,

We have an issue in Symfony Process for a long time : Process::start is blocking on Windows. It's a tricky issue and it would be awesome that we could fix this. I've proposed a patch, unfortunately it seems it does not solve the issue on all setups.

I got three different Windows implementations for Symfony/Process on Windows platform. All of them are working for me and solve the bug, but it seems some of them are failing on some installs.

I need help and if you can run the Process test suite and give feedback with the following template in this gist comments:

@romainneutron
romainneutron / gist:7596954
Last active December 29, 2015 01:59
Symfony form default data
<?php
use Symfony\Component\Form\Forms;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class ApplicationFormType extends AbstractType
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@romainneutron
romainneutron / gist:5670037
Created May 29, 2013 12:50
Phraseanet plugins manifest.json
{
"name": "Class Connector",
"description" : "A custom class connector",
"keywords" : ["connector"],
"author" : {
"name" : "Author name",
"homepage" : "http://example.com",
"email" : "email@example.com"
},
"homepage" : "http://example.com/project/example",
<?php
use Silex\WebTestCase;
class FormTest extends WebTestCase
{
public function createApplication()
{
return require __DIR__.'/../../app.php';
}
@romainneutron
romainneutron / gist:5340930
Created April 8, 2013 21:59
Download large files using Guzzle
<?php
use Guzzle\Http\Client;
require __DIR__ . '/vendor/autoload.php';
$tmpFile = tempnam(sys_get_temp_dir(), 'guzzle-download');
$handle = fopen($tmpFile, 'w');
$client = new Client('', array(
Client::CURL_OPTIONS => array(
@romainneutron
romainneutron / gist:5318519
Created April 5, 2013 11:11
React/stomp heartbeat implementation
<?php
namespace React\Stomp;
class HeartBeatClient implements ClientInterface
{
private $client;
public function __construct(ClientInterface $client, $clientGuarantee, $serverGuarantee)
{