Skip to content

Instantly share code, notes, and snippets.

View davb's full-sized avatar

Davide Bonapersona davb

View GitHub Profile
@davb
davb / stickers_vbulletin_install_howto.md
Last active December 29, 2015 06:29
How to install the Stickers add-on for vBulletin

Feeligo Stickers mod for vBulletin

The procedure below is the same you would follow to install any Product for vBulletin.

How to install

  1. Sign into your vBulletin Admin control panel

  2. Scroll down the navigation menu on the left, and expand the

@davb
davb / fib.rb
Last active December 28, 2015 09:49
fast computation of Fibonacci numbers with quick matrix exponentiation (as we were taught to do it in school)
# 2x2 matrix multiplication
# [a b] [e f] [a*e+b*g a*f+b*h]
# [c d] * [g h] = [c*e+d*g c*f+d*h]
def mult m1, m2
a, b, c, d = m1
e, f, g, h = m2
[a*e+b*g, a*f+b*h, c*e+d*g, c*f+d*h]
end
# quick exponentiation
@davb
davb / feeligo_community_api_user_token.php
Last active December 16, 2015 06:39
PHP implementation of the algorithm for generation and validation of Feeligo API Tokens
<?php
/**
* Feeligo
*
* class FeeligoCommunityApiUserToken
* Encapsulates the logic to generate and validate authentication tokens.
*
* // generation:
* $token = FeeligoCommunityApiUserToken::make(array(
* 'user_id' => '123',
@davb
davb / JSON_2.0.4.asp
Created November 14, 2012 20:44
Encoding a Feeligo Community Api User Token with Classic ASP
<%
'
' VBS JSON 2.0.3
' Copyright (c) 2009 Tuðrul Topuz
' Under the MIT (MIT-LICENSE.txt) license.
'
Const JSON_OBJECT = 0
Const JSON_ARRAY = 1
@davb
davb / mysite_user_friends_selector.php
Last active October 10, 2015 14:58
Skeleton implementation of the FeeligoUsersSelector interface
<?php
/**
* Feeligo_Mysite_User_Friends_Selector
*
* this class implements methods to find friends of a given user in
* the database and pass them as Adapters to the Feeligo API.
*/
require_once(str_replace('//','/',dirname(__FILE__).'/').'sdk/interfaces/users_selector.php');
require_once(str_replace('//','/',dirname(__FILE__).'/').'mysite_user_adapter.php');
@davb
davb / mysite_user_adapter-friends.php
Created September 12, 2012 16:02
Skeleton implementation of the FeeligoUserAdapter interface
<?php
[...]
// require the source file containing the Feeligo_Mysite_User_Friends_Selector class
require_once(str_replace('//','/',dirname(__FILE__).'/').'mysite_user_friends_selector.php');
[...]
class Feeligo_Mysite_User_Adapter implements FeeligoUserAdapter {
@davb
davb / feeligo_mysite_api.php
Last active October 10, 2015 13:28
A skeleton implementation of the FeeligoApi class
<?php
/**
* Feeligo_Mysite_Api
*
* this file provides a skeleton implementation of the Api adaptation class.
*/
/**
* Feeligo configuration settings
*/
@davb
davb / api-endpoint-controller-skeleton.php
Created September 10, 2012 21:07
A skeleton implementation of a Feeligo API Endpoint using the "expose PHP script" method.
<?php
/**
* Api endpoint controller
*
* this file is provided as a skeleton implementation of a Feeligo API Endpoint.
*/
/**
* require the SDK's built-in FeeligoController