Skip to content

Instantly share code, notes, and snippets.

View emgiezet's full-sized avatar
:octocat:
Working from home

Max Małecki emgiezet

:octocat:
Working from home
View GitHub Profile
@emgiezet
emgiezet / robot.js
Created December 4, 2012 10:52 — forked from nelsonmarcos/robot.js
Merry Go round
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot){
robot.clone();
robot.turn(45);
this.offset = 1;
};
Robot.prototype.onIdle = function(ev) {
@emgiezet
emgiezet / robot.js
Created December 4, 2012 11:11 — forked from randompast/robot.js
QR-bot-001
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(5);
robot.turn(5);
@emgiezet
emgiezet / robot.js
Created December 4, 2012 12:43 — forked from drapello/robot.js
seeker
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot){
robot.clone();
robot.turn(45);
this.offset = 1;
};
Robot.prototype.onIdle = function(ev) {
@emgiezet
emgiezet / robot.js
Created December 4, 2012 14:40
[CAELUM TEAM]Megatron
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.clone();
@mixin respond-to($media) {
@if $media == phone {
@media (max-width: 767px) { @content; }
}
@if $media == except-phone {
@media (min-width: 768px) { @content; }
}
@if $media == tablet {
@media (min-width: 768px) and (max-width: 979px) { @content; }
}
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
wget https://github.com/elasticsearch/elasticsearch/archive/v0.20.1.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share

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.