Skip to content

Instantly share code, notes, and snippets.

View pawel-dubiel's full-sized avatar

Pawel Dubiel pawel-dubiel

View GitHub Profile
@pawel-dubiel
pawel-dubiel / gist:3737873
Created September 17, 2012 15:02 — forked from mrsweaters/gist:3157259
Stop words ( json )
[
"a",
"about",
"above",
"across",
"after",
"afterwards",
"again",
"against",
"all",
@pawel-dubiel
pawel-dubiel / gist:3775917
Created September 24, 2012 13:20 — forked from davidalexander/gist:1086455
Magento Snippets

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@pawel-dubiel
pawel-dubiel / gist:4211094
Created December 5, 2012 01:22 — forked from iyshannon/robot.js
deleted
We couldn’t find that file to show.
@pawel-dubiel
pawel-dubiel / robot.js
Created December 5, 2012 15:57 — forked from rolemos/robot.js
RoLemosRobot
//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();
@pawel-dubiel
pawel-dubiel / robot.js
Created December 6, 2012 00:37 — forked from Shipow/robot.js
Shipow#001
var Robot = function(robot) {
robot.rotateCannon(-90);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead();
//i'll add a clone but i need to refactor collision
//robot.clone();
};
@pawel-dubiel
pawel-dubiel / server.js
Created December 10, 2012 04:01 — forked from jeffrafter/server.js
Twitter OAuth with node-oauth for node.js+express
var express = require('express');
var sys = require('sys');
var oauth = require('oauth');
var app = express.createServer();
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY";
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET";
function consumer() {
@pawel-dubiel
pawel-dubiel / twitter-oauth.js
Created December 10, 2012 04:02 — forked from santosh79/twitter-oauth.js
Twitter OAuth with node-oauth for node.js+express
var express = require('express');
var sys = require('util');
var oauth = require('oauth');
var app = express.createServer();
var _twitterConsumerKey = process.env['TWITTER_CONSUMER_KEY'];
var _twitterConsumerSecret = process.env['TWITTER_CONSUMER_SECRET'];
console.log("_twitterConsumerKey: %s and _twitterConsumerSecret %s", process.env['TWITTER_CONSUMER_KEY'], process.env['TWITTER_CONSUMER_SECRET']);
<?php
/**
* print_r converter - convert print_r() to php variable code
*
* Author: hakre <hakre.wordpress.com>
* Copyright (c) 2011, some rights reserved
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
console.log("got here");
var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.open("http://facebook.com", function(status) {
if ( status === "success" ) {

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.