Skip to content

Instantly share code, notes, and snippets.

View flug's full-sized avatar
:octocat:
yeah yeah yeah

Flug flug

:octocat:
yeah yeah yeah
View GitHub Profile
@flug
flug / BookController.php
Last active October 31, 2019 14:16 — forked from silviuvoicu/BookController.php
[Spec tests] Spec with phpspec a symfony2 controller. I know which is the normal work flow: write first the spec, and then the code, but in order to understand better how to spec a symfony2 controller, I first create a simple book entity with just id and name, and then with the help of generators I created a crud system, which I modified a littl…
<?php
namespace Acme\DemoBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Acme\DemoBundle\Entity\Book;
@flug
flug / gist:78713cda69bfb8126fb308bc716d1cc8
Last active October 31, 2019 14:16 — forked from jpetitcolas/gist:5967887
[PostGreSQL JSON field] Encode/decode a base64 encoded string in PostGreSQL #PostGreSQL
-- Decoding
SELECT CONVERT_FROM(DECODE(field, 'BASE64'), 'UTF-8') FROM table;
-- Encoding
SELECT ENCODE(CONVERT_TO(field, 'UTF-8'), 'base64') FROM table;
@flug
flug / Autodesk Autocad 2017 Crack + Keygen + Serial Number
Created April 19, 2017 13:21
Autodesk Autocad 2017 Crack + Keygen + Serial Number
Autodesk Autocad 2017 Free Download Keygen / Crack / Serial Number
We have put together a file that consist of keygen,crack and serial numbers that can be used to activate Autocad 2017 Trial Version and make it into a full version. Installation instructions given below and in the file.
Please GOTO: http://new-crack-keygen.com/autocad-2017-keygen-crack-download/
Instructions:
1. Download and install the trial version of autocad from the official website
2. Install the keygen
@flug
flug / tmux-cheatsheet.markdown
Created October 14, 2015 20:44 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
# delete all data
curl -XDELETE localhost:9200/test
# create an index and define specific french stop_words
curl -XPUT localhost:9200/test -d '{
"settings" : {
"index" : {
"analysis" : {
"analyzer" : {
"french" : {

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

namespace Fmdb\CoreBundle\Composer;
use Sensio\Bundle\DistributionBundle\Composer\ScriptHandler as BaseScriptHandler;
use Symfony\Component\ClassLoader\ClassCollectionLoader;
use Symfony\Component\Process\Process;
class ScriptHandler extends BaseScriptHandler
{
public static function installBowerAssets($event)
{