This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace App\Messenger\Chain; | |
use App\Messenger\Chain\Stamp\ChainStamp; | |
use Symfony\Component\Messenger\Envelope; | |
use Symfony\Component\Messenger\Stamp\StampInterface; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class WidgetManager | |
{ | |
private $em; | |
private $factory; | |
private $manipulator; | |
private $dispatcher; | |
public function __construct(ObjectManager $em, SnapshotFactory $factory, WidgetManipulator $manipulator, EventDispatcherInterface $dispatcher) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var Router = require('react-router'); | |
var SessionStore = require('../stores/SessionStore'); | |
var Stash = require('../utils/Stash'); | |
function authentication(transition) { | |
if (!SessionStore.isLoggedIn()) { | |
Stash.set('onLogin', transition.retry); | |
transition.redirect('login'); | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// what to recompile when as asset changes | |
MATCH (changed)<-[:INCLUDES*]-(recompile) | |
WHERE changed.source = "..." AND recompile.target <> NULL | |
RETURN recompile | |
// determine an asset's aggregate mtime | |
MATCH (root)-[:INCLUDES*]->(include) | |
WHERE root.source = "..." | |
RETURN max(collect(include.mtime) + root.mtime) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub vcl_recv { | |
if (req.url ~ "(?i)^/admin" && req.http.x-forwarded-for !~ "\b(<%= @ips.map{ |ip| Regexp.escape(ip) }.join('|') %>)$") { | |
error 750 "Moved Temporarily"; | |
} | |
} | |
sub vcl_error { | |
if (obj.status == 750) { | |
set obj.http.Location = "/"; | |
set obj.status = 302; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$widgets = array_combine( | |
array_map( | |
function($widget) { | |
return $widget->getId(); | |
}, | |
$widgets | |
), | |
$widgets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
use Symfony\Component\Console\Application; | |
use Symfony\Component\Console\Input\ArrayInput as Input; | |
use Symfony\Component\Console\Input\InputOption as Option; | |
require_once __DIR__.'/../vendor/autoload.php'; | |
/** Outputs and runs a command. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function walk($callback) | |
{ | |
$page = 1; | |
do { | |
$results = fetch($page++, 100); | |
foreach ($results as $result) { | |
call_user_func($callback, $result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use JMS\DiExtraBundle\Annotation as DI; | |
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; | |
/** @DI\Service */ | |
class QSAListener | |
{ | |
private $blacklist; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace OpenSky\Bundle\MainBundle\Listener; | |
use Symfony\Component\HttpKernel\Event\GetResponseEvent; | |
use Symfony\Component\Security\Core\Exception\AccessDeniedException; | |
use Symfony\Component\Security\Core\SecurityContextInterface; | |
/** | |
* Listens to kernel.request after the router and checks required role. |
NewerOlder