Skip to content

Instantly share code, notes, and snippets.

View rande's full-sized avatar
🖖
hello!

Thomas rande

🖖
hello!
View GitHub Profile
<?php
// this check prevents access to debug front controllers that are deployed by accident to production servers.
// feel free to remove this, extend it, or make something more sophisticated.
if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
'127.0.0.1',
'::1',
'84.14.82.2',
'88.175.92.100',
))) {
<?php
namespace Sonata\Bundle\ScreenyBundle\Consumer;
use Sonata\Bundle\ScreenyBundle\Screeny\UrlShotManager;
use PhpAmqpLib\Message\AMQPMessage;
use OldSound\RabbitMqBundle\RabbitMq\Producer;
class UrlShotConsumer
{
<?php
/*
* This file is part of the Sonata project.
*
* (c) Thomas Rabaix <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@rande
rande / gist:4981650
Last active December 13, 2015 21:59
Sonata Media Bundle
===================
Media path generation: http://mycdn.com/context/01223/023/thumb_1232_small.jpg
1. CDN http://mycdn.com
2. Path Generator : context/01223/023
3. Thumbnail - internal generation: thumb_1232_small.jpg
4. Thumbnail - return the relative path: context/01223/023/thumb_1232_small.jpg
class consumer(twistedhttpstream.MessageReceiver):
def connectionMade(self):
print "connected..."
def connectionFailed(self, why):
print "cannot connect:", why
reactor.stop()
def messageReceived(self, tweet):
print "new message:", repr(tweet)
Problem 1
- Installation request for sonata-project/user-bundle 2.1.*@dev -> satisfiable by sonata-project/user-bundle 2.1.x-dev.
- sonata-project/user-bundle 2.1.x-dev requires sonata-project/admin-bundle 2.1.x-dev -> no matching package found.
Problem 2
- Installation request for sonata-project/page-bundle 2.1.*@dev -> satisfiable by sonata-project/page-bundle 2.1.x-dev.
- sonata-project/page-bundle 2.1.x-dev requires symfony-cmf/routing-extra-bundle 1.0.* -> no matching package found.
Problem 3
- Installation request for sonata-project/media-bundle 2.1.*@dev -> satisfiable by sonata-project/media-bundle 2.1.x-dev.
- sonata-project/media-bundle 2.1.x-dev requires sonata-project/admin-bundle 2.1.x-dev -> no matching package found.
import ioc.loader
import os
class Extension(object):
def load(self, config, container_builder):
path = os.path.dirname(os.path.abspath(__file__))
loader = ioc.loader.YamlLoader()
loader.load("%s/resources/config/services.yml" % path, container_builder)
@rande
rande / gist:6615971
Last active December 23, 2015 09:39
<?php
namespace Stats\Test;
use Stats\Entry;
interface ComputerInterface
{
/**
* @return string
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.ssh.forward_agent = true
config.vm.define "default", primary: true do |web|
web.vm.box = "ubuntu13_04"
web.vm.box_url = "https://dl.dropboxusercontent.com/s/eo85etnrthnrrfn/ubuntu_13_04.box"
#!/bin/sh -ex
# reset local junit data
rm -rf junit; mkdir junit
# update puppet submodules
git submodule update --init
# add the ssh agent, so capistrano can use it
eval `ssh-agent`; ssh-add /var/lib/jenkins/.ssh/id_rsa