Simple JavaScript ‘Frame Busting’ Code

April 16th, 2009 | Save to del.icio.us now

Here is a quick JavaScript  code that you can use if you want to make sure that no one should be able to show your website in an IFrame.

<script type="text/javascript">
if (top !=self) {
   top.location=self.location;
}
</script>

Just put this code in head section of your html page, and it will ensure that your page always get’s displayed outside the frames.



One Year Of Writing

February 27th, 2009 | Save to del.icio.us now

On 25th February this blog turned 1 year old.

I am happy to say that in my 3rd attempt to be a blogger I have finally succeded.

Thank you every one for commenting and reading which kept my interest alive.



How do I find out more about the startup ecosystem in Pune?

February 12th, 2009 | Save to del.icio.us now

Their was a very good discussion that happened at Pune  startups mailing list.  Topic of discussion was how do students find a way to get inside startup fraternity. Result of that discussion is that, we now have POCC-students group and mailing list created to help fill the gap.

What is the most interesting is,  we were discussing how to get students invlove in open source, while techstart.in group was formed to give students mentoring.

Anyways,  I thought I will just put action points from that mailing list as a blog post so that few more people could find it.

Here is what Navin and other’s believe should be done by students to connect with  Pune startup faternity.

To stay plugged in to the Pune startup ecosystem, I suggest the following:

1. Subscribe to the PuneStartups (POCC) mailing list:
http://groups.google.com/group/punestartups
2. If you are a student, or interested in students, subscribe to the
POCC mailing list: http://groups.google.com/group/pocc-students
3. Stay in touch with Pune tech community events and other information
via PuneTech: http://punetech.com/subscribe
4. Join twitter. I’ve found that twitter is a great place to get
information about Pune Startups. On twitter follow @punetech

As startups always look for passion and skill in people they hire, so being active on one of the forums mentioned below can increase you chance of getting hired and also to interact and find mentors in local community.

Please choose according to your interest

  1. Join PHPCamp mailing list http://groups.google.com/group/phpcamp
  2. Join Drupal India Community mailing list at http://groups.drupal.org/india
  3. Join Joomla User Group Pune mailing list at http://groups.google.com/group/jugpune
  4. Join Barcamp pune mailing list at http://tech.groups.yahoo.com/group/barcamp-pune
  5. If mailing list is to much for you, then follow some of the most active pune techies and tech events on twitter.

Again, I am biased towards PHP and PHP Community, so I have very limited knowledge of other tech events and their mailing list, So if any one of you are active on any other mailing list that is useful for students than please leave a comment I will update the post.

Are you satisfied with your knowledge? No, then spent 15 minutes every day on PHPCamp.net a knowledge sharing website for our own PHP community

Update

Here are few more groups for you

  1. Join Null group at http://null.co.in/, they talk only about cyber security and hacking.
  2. Join Flex users mailing list at  http://groups.google.co.in/group/pune-flex-users
  3. Join Pune Linux User group at http://www.plug.org.in/mailman/listinfo/plug-mail
  4. For Techie Girls out their, Join LinuxChix  http://mailman.linuxchix.org/mailman/listinfo/indichix
  5. Join Ruby users mailing list at http://tech.groups.yahoo.com/group/puneruby/
  6. Join Pune Java User Group http://groups.google.com/group/Pune-Java

So many options, and still students ask where to look?



Debugging PHP using Xdebug and Notepad++ : Part 2

February 5th, 2009 | Save to del.icio.us now

In my previous post, I have shown how to configure Xdebug and Notepad++ for debugging.

In this final part, I will take some example to demonstrate and show how to use the setup to make  debugging an PHP script easier and actually fun.

Initially I thought that I will write an article, but then I thought it is better if I do a screencast. This is my first(well it is second but that was without voice long time back) and voice of the screencast is not so good, you will need a headphone to get the voice clearly.

I have shown the debugging using a Joomla content component.

Continue reading »



Integrating With Twitter API In CodeIgniter

January 29th, 2009 | Save to del.icio.us now

I needed to integrate Twitter API in one  of my web applications which uses CodeIgniter framework.

 

As their is no direct library available in CI for twitter integration, at first go this might look very difficult, but it is really simple.

 

Here is how you can do it..

  1. First download the  Twitter class for PHP.
  2. Put the class.twitter.php file in application/libraries folder.
  3. Rename class.twitter.php to twitter.php ( to make it compatible with CI naming conventions).
  4. Open twitter.php file and set following variables
var $username=’'; //twitter username
var $password=''; // twitter password
var $user_agent=''; //an identifier for twitter preferably email address
Are you satisfied with your knowledge? No, then spent 15 minutes every day on PHPCamp.net a knowledge sharing website for our own PHP community

If you have followed these steps your integration is almost complete, now all you need to do is use the twitter library, here is an example to get you started :)

 $this->load->library('Twitter');
 $msg=’Just Integrated Twitter with CodeIgniter ’;
 $this->twitter->update($msg);

By the way you can follow me on twitter @thecancerus.



Debugging PHP using Xdebug and Notepad++ : Part I

January 25th, 2009 | Save to del.icio.us now

I am sure all of you have used ‘echo’ and ‘print_r’ to debug PHP.

We all know that this way debugging is hard and you need to remember to remove them from production server.

Well, thanks to xdebug you can now debug, and you don’t need expensive or blotted IDE for that, just plain and simple Notepad++ can do the job.open php.ini in wamp

In this post we will setup xdebug and DBGp plugin with Notepad++.

Let’s start by installing xdebug.

  1. Download the latest release of xdebug for PHP version you are using.
  2. Copy xdebug dll file into php’s extension directory, in my case, as I use wamp, it is c:\wamp\php\ext .
  3. Now we need to configure xdebug so that it get recognized by PHP, so open php.ini
  4. Add following at the end of your php.ini file
    [xdebug]
    zend_extension_ts="c:/wamp/php/ext/php_xdebug-2.0.3-5.2.5.dll"
    xdebug.profiler_output_dir = "c:/wamp/tmp/xdebug"
    xdebug.profiler_output_name = "cachegrind.out.%p"
    xdebug.profiler_enable = 0
    xdebug.profiler_append=0
    xdebug.extended_info=1
    xdebug.remote_enable=1
    xdebug.remote_handler=dbgp
    xdebug.remote_mode=req
    xdebug.remote_host=127.0.0.1
    xdebug.remote_port=9000
    xdebug.idekey=xdebug
    xdebug.remote_log="c:/wamp/tmp/xdebug/xdebug_remot.log"
    xdebug.show_exception_trace=0
    xdebug.show_local_vars=9
    xdebug.show_mem_delta=0
    xdebug.trace_format=0
  5. Just create a folder ‘xdebug’ in ‘c:\wamp\tmp’ folder.
  6. Finally restart Apache service .

With these steps you have, finished xdebug installation, it is configured for profiling application and remote debugging. Check documentation to know what all these configuration do, and tweak according to your preference.

Continue reading »



Round off

January 19th, 2009 | Save to del.icio.us now

Their are lot’s of tech events happening in Pune.

Recently Concluded was IdeaCamp 2, you can read about it on Bhavya’s blog post.

Upcoming events that I know of

  1. WATBlog Wednesday Pune on 21st January,
  2. Drupal Camp Pune, it is going to happen on 31st January,
  3. On 13th – 14 Feb( yes !!!) we are having Gnunify’09.  and
  4. Joomla Day India, for the first time in India, we will have a day dedicated to Joomla. This will happen on 25th April.  Announcement about it should happen in a day or two.

Too know about more tech events that are happening or happen in Pune, keep checking Pune Tech Events Calendar.

For last few week I have been doing lot of things and learned a lot, stay tuned..  till then

Have fun



India I Care, So Let’s Be Social..

December 22nd, 2008 | Save to del.icio.us now

We are happy to announce the success of Opensocial Developer Garage.

We were able to prototype the ‘India I Care’ orkut app for IOFC. It will be soon released for everyone to use. We build this app with active contribution from Shardule, Rohan, Parag and our speaker Shishir.

Priyank and Aman has already covered the event in detail, also check what another speaker Arpana has to say about it.

Photos of the event :

http://picasaweb.google.co.in/thecancerus/OpensocialDeveloperGarage08

From Opensocial Developer garage’08

I would like to thank everyone who made this event possible.

Have fun.



FireUnit

December 18th, 2008 | Save to del.icio.us now

Today John Resig, Jan Odvarko released ‘FireUnit’ a very useful JavaScript unit testing extension for Firebug.

Fireunit will make JavaScript logging very easy, and we will not have to use alert boxes any more.

You can download the extension at http://fireunit.org/



Step By Step Guide To Install Memcache On Linux

December 18th, 2008 | Save to del.icio.us now

This post is more like a note to me, so that in future I can look up for steps involved in installing memcache on Linux servers like Centos or RHEL.

Those of you who follow me on twitter, will know that me and my friends spends hours trying to install memcache on one of our web server. Normally this is a five minute job, but unfortunately for us those tricks did not work out.

So if you have tried YUM and APT-GET and still could not install the memcache then read on, to find the alternate( read manual, without magic ) way of doing it.

When we talk about Memcache their two things that needs to be installed

  1. Memcache Daemon know as memcached, and
  2. Memcache client for your programing language, in this case PHP.

Continue reading »