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
@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>
<?php
class Foo
{
public function doSomething()
{
return $this;
}
}
<?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
{
@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
/** @Entity */
class Foo
{
/** @Id @Column(...) */
private $id;
/** @Column(...) */
private $prop;
@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"}
@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');
<?php
use \AMQPQueue,
\AMQPChannel,
\AMQPExchange,
\AMQPEnvelope,
\AMQPConnection;
require __DIR__ . '/vendor/autoload.php';
<?php
use Symfony\Component\Process\ProcessBuilder,
Symfony\Component\Process\ProcessUtils;
$builder = new ProcessBuilder;
$builder->setPrefix(['--argument-name', 'argument value']);
// after the ProcessUtils
@Taluu
Taluu / gist:9470625
Created March 10, 2014 18:08
One tagcloud to rule them all
<?php
/*
* Several strings to interpret
* With possibly several expressions in each of those
* In the service where the cloud lies within
* One string to interpret, One string to ease the perfs
* One string to bring out some stats, and in an array binds them
* In the service where the cloud lies within
*/
// some code §