~ where coding happens ~
18 Jun
As more and more users are getting into the Facebook (FB for brevity), it is becoming the most common communication platform or online social media. I won’t be surprised if the day comes that the term “facebook” will the first word that comes to a person’s mind when asked about online communication (rather than the word “email”).
Recently, Facebook launched its “Facebook Connect” platform where third-party websites can seamlessy integrate facebook authentication into their existing websites. Some companies are confused with the overall idea of “Facebook Connect” and are hesitant in implementing the technology and evasively sees it as a threat to legacy systems and a potential security breach on their existing clientèle or users database. Well, they are wrong because Facebook Connect doesn’t care about their existing system and information.
Here’s how Facebook Connect works. Let’s say we have ‘Company A’. Members/Subscribers of the ‘Company A’s website will be presented with two (2) options before they can login into the website. They can either:
a. Login using their account in a normal login process. Normal login process of course will just cross reference the credentials to the database, pretty straighforward.
b. ‘Facebook Connect’ login on the other hand, checks the cookie of the browser if there is an existing Facebook login (even if they are in other windows or tabs of your browser) and use this information to login to ‘Company A’s website. On the first run, the user will still be prompted if they want to allow ‘Company A’s website to access the Facebook Application. Upon confirmation, the user will automatically be redirected to ‘Company A’s website with some credentials or information about the current logged in user in Facebook. This logged in user can then be associated with the native account on ‘Company A’s website so succeeding Facebook Connect logins will be much faster with just a click of a button (as long as you are logged-in in facebook).
What then is the importance of having a Facebook Connect on your website? Below are some points I can think of:
- avatars will be directly loaded from the user’s primary photo in facebook. This will save you from the pain of uploading, cropping, and image processing of your user’s avatar. This also means free disk space and bandwidth utilization from your website.
- increase membership since there will be an ‘invite your facebook friends’ to sign up with your website
- easier registration since facebook connect can pull out basic information from facebook like birthday, location, gender, country, etc.
- expect more frequent logins since facebook and your website will share the same cookie for login. (Who doesn’t login to facebook these days?)
- promote actions to facebook updates. (e.g “Efren promotes his profile @ Company A’s page. Click here to promote yourself. “). This will bring traffic to your website and a FREE marketing tool as well.
- etc…
Based on what I understand, I don’t see any other reason why companies will not take advantage of having a “Facebook Connect”-enabled website. The only things needed are courage to take risks, a web developer, cups of coffee, and a backup of your existing database (in case something went wrong). Go try and see its worth.
9 Jun
To solve the problem of unable to play MP3 files on Ubuntu Jaunty Jackalope:
sudo aptitude install libxine1-ffmpeg
5 Apr
Recently, I was asked by my colleagues to burn a video file to a DVD. Here are the steps how I managed to accomplish this task using my Ubuntu box.
1. Create the folders and the file structure:
dvdauthor -o newdvd -t /path/to/your/movie.mpg
2. FInalize the structure:
dvdauthor -o dvd -T
3. Create the ISO file from the folder created:
mkisofs -dvd-video -o newdvd.iso newdvd/
4. Use a DVD burning software like GnomeBaker (using sudo apt-get install gnomebaker)
5. Get some popcorn and sodas. Enjoy your movie!
4 Apr
Using the SphinxBehavior, you can filter out the search query based on the record owner. Imagine you have a ‘Clients’ table that belongs to an ‘Account’. In cakePHP, this requires you to have a field ‘account_id’ in the ‘clients’ table. In order to perform a query to Sphinx to return the records only owned by the current user, you need to do this:
$this->userinfo = $this->Auth->user(); //assuming you are using Auth component
$sphinx = array( 'index' => array('clients'), 'filter' => array( array( 'account_id', $this->userinfo['Account']['id'])), 'matchMode' => 'SPH_MATCH_ALL', 'sortMode' => array( 'SPH_SORT_EXTENDED' => '@weight DESC, @id DESC' ));
3 Apr
Recently, I discovered the power of using Google’s AJAX libraries API. This is a content delivery network that delivers popular open source javascript frameworks using Google’s “stable, reliable, high speed, and globally available access“. Inside my CakePHP application, i simple added this on the header:
echo $javascript->link('http://www.google.com/jsapi');
echo $javascript->codeBlock("google.load('mootools', '1.2.1');");
It sure loads the mootools ‘core’ faster. Downside is that I need to manually include the ‘more’ library from mootools. I sure hope my hosting loads as fast as Google’s servers. LMAO
2 Apr
I was using SphinxBehavior and I ran into a situation where i need to search from a specific index only. My sphinx installation currently has 3 indexes — clients, loans, and companies. By default, the SphinxBehavior searches across these 3. In order to search from 1 index only, you need to do this:
$sphinx = array('index'=>array('clients'),'matchMode' => 'SPH_MATCH_ANY', 'sortMode' => array('SPH_SORT_EXTENDED' => '@weight DESC, @id DESC'));
This makes the bahavior search for the record inside the index ‘clients’ only.
Hope this is helpful.
4 Mar
Creating a website nowadays has become painless that almost any internet savvy person can do one. With the existence of open source content management systems (CMS) like wordpress, drupal, and joomla to the free ecommerce applications like oscommerce, zen-cart, and magento, the implementation can be as fast as 5 minutes. You just need to know the basics of FTP, web servers and setting up of a database.
Basic website development is out. API and services is the new IN. More and more companies are investing on creating (or reinventing) their own flexible “service” where end-users and developers can take advantage of.
Designing your system to act as an API-driven service will give your clients the benefit of flexibility. It simply lets your end-users, clients, and fellow developers be creative in using your service. They can do a lot of things like developing another website to interact with your service, create a desktop application using adobe AIR, a Google gadget, mobile application for iPhone, a JAVA application, or they can simply interface their existing system with your service. The possibilities are endless.
15 May
Since cake 1.2, there is already an implementation to dynamically add (or include) a javascript file in the header. This is done in case you need to include a new js file in the header on one of your modules. This will prevent putting the code in the default layout and loading unnecessary javascript files in the header.
<?php echo $javascript->link('nameofjstoadd',false); ?>
This is called in the default.ctp using ‘$scripts_for_layout’ directive inside the header.
15 May
To install the last.fm client on the latest Ubuntu hardy heron, simply run this on the terminal:
$ sudo apt-get install lastfm
As simple as that.
13 May
This is a quick fix to make your firefox load java when accessing java enabled sites. Simply do this in the terminal:
$ cd /usr/lib/firefox-3.0b5/plugins
$ sudo ln -s /usr/lib/jvm/java-6-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so
Posting tweet...