Skip to content

Instantly share code, notes, and snippets.

View jverdeyen's full-sized avatar

Joeri Verdeyen jverdeyen

View GitHub Profile
@egonSchiele
egonSchiele / why.markdown
Last active July 20, 2018 01:40
Why read Grokking Algorithms?

If you have already taken a course in algorithms, why read Grokking Algorithms (manning.com/bhargava)?

If you were learning graph algorithms, which approach would you prefer:

  1. Imagine you have to take public transit from your home to your office. How do you figure out the fastest route? Use graph algorithms! OR

  2. We can choose between two standard ways to represent a graph G = (V, E): as a collection of adjacency lists or as an adjacency matrix. Either way applies to both directed and undirected graphs.

I prefer the first way: lead with lots of examples, and clear writing. The second way is an excerpt from "Introduction to Algorithms"...that's how they start their section on graph algorithms.

@mpalourdio
mpalourdio / php-cs-fixer
Created November 12, 2014 21:24
@fabpot php-cs-fixer config for PhpStorm
parameters
--level=psr2 --verbose fix $FileDir$/$FileName$
working directory
$ProjectFileDir$
@tjamps
tjamps / README.md
Last active February 29, 2024 14:57
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

@linxlad
linxlad / ManualLogin.php
Created April 17, 2015 16:40
Custom Authentication Class with Symfony 2.6
<?php
/**
* @Author: Nathan Daly
* @Date: 17/04/15
*/
namespace AppBundle\Security;
use Doctrine\ORM\EntityManager;
use Symfony\Component\DependencyInjection\Container;
@borestad
borestad / bootstrap.sh
Last active September 2, 2015 06:09
Debian Jessie custom/stripped KVM host with some useful tools (on a Macbook Air)
wget --no-cache -O- https://gist.githubusercontent.com/borestad/ddab79ed5d3412248eed/raw/f7050315505df4287bd54ca514b0a94c7f1848ff/install.sh | /bin/bash
@mickaelandrieu
mickaelandrieu / upgrade2.3-to-2.7.md
Last active May 21, 2024 03:39
Complete migration guide from Symfony 2.3 LTS to Symfony 2.7 LTS

From Symfony 2.3 to Symfony 2.7: the complete guide

Objectives

  • assume your code doesn't use any deprecated from versions below Symfony 2.3
  • update dependencies from 2.3 to 2.7
  • do not support "deprecated", be "Symfony3-ready"
  • list tasks component by component, bundle by bundle.
@ofbeaton
ofbeaton / TwigSubscriber.php
Last active May 7, 2022 16:11
Symfony 2.6+ User Timezone
<?php
namespace AppBundle\EventListener;
use AppBundle\Entity\User;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
/**
@SebLours
SebLours / DurationTransformer.php
Created July 5, 2015 13:40
Symfony2 duration datatransformer
<?php
namespace AppBundle\Form\DataTransformer;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
class DurationTransformer implements DataTransformerInterface
{
/**
@damienalexandre
damienalexandre / ProfilerController.php
Created July 5, 2015 15:10
Adding a checkbox on the translation panel + custom save controller
<?php
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class ProfilerController extends Controller
@0XDE57
0XDE57 / config.md
Last active May 30, 2024 19:04
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".