Skip to content

Instantly share code, notes, and snippets.

View ahilles107's full-sized avatar

Paweł Mikołajczuk ahilles107

View GitHub Profile
/**
* {@inheritdoc}
*/
public function start(Request $request, AuthenticationException $authException = null)
{
if ($this->options->get('server_url') & $this->options->get('app_url')){
$redirect_uri = str_replace($this->options->get('server_url'), $this->options->get('app_url'), $request->getUriForPath($this->options->get('check_path', '')));
} else {
$redirect_uri = $request->getUriForPath($this->options->get('check_path', ''));
}
@ahilles107
ahilles107 / gist:2114087
Created March 19, 2012 14:22
FlexSocial intergation part1
<!doctype html>
<head>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
...
<script src="http://flexpi.com/api/beta/flexpi.min.js"></script>
@ahilles107
ahilles107 / gist:2114653
Created March 19, 2012 14:40
FlexSocial intergation part2
<body>
<script type="text/javascript">
flex.connect({
app_id : 00000
}, function(){
// run code when connection is ready
});
</script>
...
}, function(){
// run code when connection is ready
$('body button.login').click(function(){
flex.social.facebook.login(function(res){
flex.social.facebook.getUser(function(userData){
console.log(userData);
});
});
})
@ahilles107
ahilles107 / gist:2204544
Created March 26, 2012 11:38
FlexSocial BrowserID
...
}, function(){
// run code when connection is ready
flex.social.browserid.init();
$('.loginPage #browserid').click(function(){
flex.social.browserid.login(function(result, data, assertion) {
if(result === true) {
// result == {
// "status": "okay",
// "email": "contact@flexpi.com",
@ahilles107
ahilles107 / gist:2282341
Created April 2, 2012 10:09
FlexSocial GG init + login
...
}, function(){
// run code when connection is ready
flex.social.gg.init(function(){
$('.loginPage #loginWithGG').click(function(){
flex.social.gg.login(function(res){
console.log('res');
// do something after login
}, function(res){
// do something with res after failed login
@ahilles107
ahilles107 / gist:2282387
Created April 2, 2012 10:17
FlexSocial GG get User Data
...
flex.social.gg.login(function(res){
console.log('res');
// do something after login
flex.social.gg.getUser(function(userData){
// do something with userData
console.log('Hello' + userData.users[0].label)
});
...
@ahilles107
ahilles107 / gist:2349581
Created April 10, 2012 09:06
FlexBadges get info about badge.
...
flex.badges.badge.get('badge_id', function(badgeData){
// do something with badge data in res
// console.log(badgeData)
});
...
@ahilles107
ahilles107 / gist:2349593
Created April 10, 2012 09:07
FlexBadges set badge to user
...
flex.badges.user.set('user_id', 'badge_id', function(res){
// do something with res
// console.log(res);
});
...
@ahilles107
ahilles107 / widget-class-1
Created October 19, 2012 11:42
Widget Class
// newscoop/extensions/test-widget/TestWidget.php
<?php
class TestWidget extends Widget // implements IWidget class with only render method
{
public function render()
{
echo 'Test Widget!';
}
}