Skip to content

Instantly share code, notes, and snippets.

View ilario-pierbattista's full-sized avatar
🏠
Working from home

Ilario Pierbattista ilario-pierbattista

🏠
Working from home
View GitHub Profile
@koenpunt
koenpunt / chosen-bootstrap.css
Last active March 11, 2023 01:01
Bootstrap 3.0 theme for Chosen
select.form-control + .chosen-container.chosen-container-single .chosen-single {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555;
vertical-align: middle;
background-color: #fff;
@danvbe
danvbe / 1-Explanations.md
Last active February 20, 2025 12:31
A way to integrate FosUserBundle and HWIOAuthBundle

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.
@bripkens
bripkens / gist:3769436
Created September 23, 2012 09:10
DOT file for finite state machine diagrams.
digraph finite_state_machine {
rankdir=LR;
node [shape = doublecircle]; 1;
node [shape = circle] 0;
node [shape = plaintext, label = ""]; start;
start -> 0 [ label = "start"];
0 -> 1 [ label = "[1-9]" ];
1 -> 1 [ label = "[0-9]" ];
<?php
class JsonDecoder implements DecoderInterface {
public function decode( $data )
{
$decoded = @json_decode( $data, true );
$decoded = $this->removeBooleans( $decoded );