Skip to content

Instantly share code, notes, and snippets.

View ahilles107's full-sized avatar

Paweł Mikołajczuk ahilles107

View GitHub Profile
{
"guid": "http:\/\/www.ncregister.com\/daily-news\/bethlehems-catholic-maternity-hospital-hit-hard-by-holy-land-coronavirus-lo",
"slugline": "bethlehem-8217-s-catholic-maternity-hospital-hit-hard-by-holy-land-coronavirus-lockdown",
"priority": 5,
"service": [
{
"name": "World",
"code": "world"
}
],
@ahilles107
ahilles107 / deploy.php
Last active June 13, 2021 21:23
Example deployphp/deployer config for Superdesk Publisher
<?php
namespace Deployer;
use Deployer\Task\Context;
require 'recipe/symfony.php';
// Servers
inventory('servers.yaml');
@ahilles107
ahilles107 / supervisord.conf
Last active April 5, 2018 11:20
Superdesk Publisher supervisord config for travis
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
#
# This is an example VCL file for Varnish.
#
# It does not do anything by default, delegating control to the
# builtin VCL. The builtin VCL is called when there is no explicit
# return statement.
#
# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/
# and https://www.varnish-cache.org/trac/wiki/VCLExamples for more examples.
<?php
namespace SWP\Node;
/**
* Gimme twig node.
*/
class GimmeNode extends \Twig_Node
{
private static $count = 1;
<?php
namespace SWP\Parser;
use SWP\Node\GimmeNode;
/**
* Parser for gimme/endgimme blocks.
*/
class GimmeTokenParser extends \Twig_TokenParser
<?php
namespace SWP\Extension;
use SWP\Parser\GimmeTokenParser;
class GimmeExtension extends \Twig_Extension
{
/**
* Simple data loader implementation.
@ahilles107
ahilles107 / services.yml
Created August 10, 2017 10:35
TenantAwareCache service declaration
services:
swp.twig.cache.tenant_aware:
class: SWP\Bundle\CoreBundle\Twig\Cache\TenantAwareCache
arguments:
- '%kernel.cache_dir%/twig'
- '@swp_multi_tenancy.tenant_context' #this is our tenant context service
<?php
namespace SWP\Bundle\CoreBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
final class AddCustomTwigCachePass extends AbstractOverridePass
{
public function process(ContainerBuilder $container)
<?php
namespace SWP\Bundle\CoreBundle\Twig\Cache;
use SWP\Bundle\MultiTenancyBundle\Context\TenantContext;
class TenantAwareCache extends \Twig_Cache_Filesystem
{
private $directory;
private $tenantContext;