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 / install.sh
Created October 5, 2016 08:37
Oro install and recreate db
#!/bin/bash
application=$1
env=$2
if [ -z "$application" ]; then echo "application must be passed as an argument"; exit; fi
if [ -z "$env" ]; then
echo "env set to dev";
env='dev';
@emgiezet
emgiezet / .bashrc
Last active December 16, 2015 01:19
My developer git & bash config!
# Sexy Bash Prompt, inspired by "Extravagant Zsh Prompt"
# Screenshot: http://img.gf3.ca/d54942f474256ec26a49893681c49b5a.png
# A big thanks to \amethyst on Freenode
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color
elif [[ $TERM != dumb ]] && infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color
fi
if tput setaf 1 &> /dev/null; then
tput sgr0

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.
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
@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; }
}
@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();
@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 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 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 10:04
DumbCracker
//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) {