Skip to content

Instantly share code, notes, and snippets.

View Taluu's full-sized avatar
🖕
vim is the true editor !

Baptiste Clavié Taluu

🖕
vim is the true editor !
View GitHub Profile
<?php
use \AMQPQueue,
\AMQPChannel,
\AMQPExchange,
\AMQPEnvelope,
\AMQPConnection;
require __DIR__ . '/vendor/autoload.php';
@Taluu
Taluu / gist:2df7cdbdb2e792a2eb04
Last active August 29, 2015 14:02
"twitter sdk"
<?php
use Guzzle\Http\Client,
Guzzle\Plugin\Oauth\OauthPlugin;
$oauth = [/* ... */];
$plugin = new OauthPlugin($oauth);
$client = new Client('https://api.twitter.com/1.1');
@Taluu
Taluu / debug 3.0
Last active August 29, 2015 14:06
elephant debug
info - socket.io started
debug - client authorized
info - handshake authorized dalE823IiAof2aYIc5Vj
debug - setting request GET /socket.io/1/websocket/dalE823IiAof2aYIc5Vj/?
debug - set heartbeat interval for client dalE823IiAof2aYIc5Vj
debug - client authorized for
debug - websocket writing 1::
user connected
here we are in action event and data is: {"foo":"bar"}
<?php
/** @Entity */
class Foo
{
/** @Id @Column(...) */
private $id;
/** @Column(...) */
private $prop;
@Taluu
Taluu / Tag.php
Last active August 29, 2015 14:10
<?php
namespace Acme\TagBundle\Entity;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM,
Doctrine\Common\Collections\ArrayCollection;
/**
* Tag Entity
<?php
use Swarrot\Consumer;
use Swarrot\Broker\MessageProvider\PeclPackageMessageProvider;
use Swarrot\Broker\MessagePublisher\PeclPackageMessagePublisher;
use Swarrot\Broker\Message;
use Swarrot\Processor\RPC\RpcClientProcessor;
use Swarrot\Processor\ProcessorInterface;
class Processor implements ProcessorInterface
{
<?php
class Foo
{
public function doSomething()
{
return $this;
}
}
@Taluu
Taluu / attrape.c
Last active August 29, 2015 14:17
old owrk done years ago
/**
* Projet 2 - Attrape-Sous
* BRISSET Dimitri & CLAVIE Baptiste
* L1 Promo 2012 - Groupe C
* Pour le 30/01/2008
*/
#include "conio.h"
#include <time.h>

Wording

We will develop an awesome game named Da Movie Quizz, which will will test the cinematographic culture of the player. The main purpose is very simple:

Each round, we suggest an actor and a movie poster. The player must say if the actor has performed in the movie or not.

At the first wrong answer, game over. As long as the player gives a right answer, the game continues.

Simple, basic and fun !

What we expect

<?php
class Foo implements Serializable
{
public $foo, $bar;
public function serialize()
{
return json_encode(['foo' => $this->foo, 'bar' => $this->bar]);
}