Skip to content

Instantly share code, notes, and snippets.

@jarvys
jarvys / run-multiple-redis-instances.md
Last active September 27, 2022 13:02
run multiple redis instances on the same server for centos
  • create a new redis .conf file
$ cp /etc/redis.conf /etc/redis-xxx.conf
  • edit /etc/redis-xxx.conf, illustrated as below
...
@krakjoe
krakjoe / pthreads.md
Last active August 30, 2023 18:30
pthreads.md

Multi-Threading in PHP with pthreads

A Brief Introduction to Multi-Threading in PHP

  • Foreword
  • Execution
  • Sharing
  • Synchronization
  • Pitfalls

Redis FAQ or: what you learn when idling in #redis

First: this here is the unofficial FAQ, only containing things that come up by users in the IRC channel #redis on Freenode. There's also a more official FAQ. This document is also available on my site.

X is weird in my instance. Can you help?

Maybe. To better help please give the following info:

  • Output of redis-cli INFO
  • Output of redis-cli CONFIG GET '*'
@adrienbrault
adrienbrault / 1_hateoas.md
Last active December 18, 2015 18:30
Hateoas php library features ideas/wishlist

I'm about to start writing a new php library for hateoas stuff. Here are my thoughts about what features it should have. If you have comments/suggestions/ideas/requests/whatever, please comment the gist.

  • php 5.3 library
  • hooking into the jms serializer
  • support multiple hateoas "formats/standards" (hal, etc)
  • configuration layer
    • static configuration: php, yaml, annotations, extension api for other libraries (being cached)
    • dynamic configuration, attach configuration to an object
@dework
dework / MenuBuilder.php
Created December 1, 2012 18:18
Symfony 2 breadcrumbs based on KnpMenuBundle
<?php
namespace Chyrius\PublicBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\HttpFoundation\Request;
use Chyrius\PublicBundle\Menu\RequestVoter;
use Symfony\Component\DependencyInjection\ContainerInterface;
class MenuBuilder
@lavoiesl
lavoiesl / ContactControllerTest.php
Created July 9, 2012 20:11
PHPUnit test for Symfony2 to test email sending
<?php
namespace Acme\DemoBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class ContactControllerTest extends WebTestCase
{
public function testContact() {
@tystr
tystr / phpunit_bootstrap.php
Created August 8, 2011 23:56
Symfony2 PHPUnit Bootstrap
<?php
// include symfony2 bootstrap
include 'bootstrap.php.cache';
abstract class BaseTestCase extends \Symfony\Bundle\FrameworkBundle\Test\WebTestCase
{
protected $client;
public function setUp()