Skip to content

Instantly share code, notes, and snippets.

@frodosghost
frodosghost / CorsListener.php
Created April 14, 2016 02:35
CORS Listener and Handling with Symfony2
<?php
namespace AppBundle\EventListener;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
@frodosghost
frodosghost / LegacySessionStorage.php
Last active April 28, 2016 12:11 — forked from tcz/LegacySessionStorage.php
Bridging the gap between standard $_SESSION and HttpFoundation Session with Silex.
<?php
namespace Session\Storage;
use Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage;
/**
* Session storage that avoids using _sf2_attributes subkey in the $_SESSION
* superglobal but instead it uses the root variable.
*
@frodosghost
frodosghost / bubblesort.php
Created May 30, 2018 03:51
Sorting Algorithms using PHP
<?php
/**
* BubbleSort in PHP
*
* @param array $data
* @return array
*/
function bubblesort ($data) {
$length = count($data);
@frodosghost
frodosghost / keybase.md
Created February 3, 2020 00:10
Keybase

Keybase proof

I hereby claim:

  • I am frodosghost on github.
  • I am frodosghost (https://keybase.io/frodosghost) on keybase.
  • I have a public key ASCjXhben2bdA5Zk-N27SCbBCDm127WRyO2gkmryZ-K9dAo

To claim this, I am signing this object: