The Discussion Delegate

Answers to the Ultimate Questions about the Web, Mobile and Vercingetorix

 

Custom URLs for WordPress plugins

This post was created on May 25th, 2010 by Adhip and has 0 comments. It has been filed

WordPress is great at handling URLs and making them ‘pretty’ with custom permalinks. You can use almost any kind of URL structure for your website using the ‘Custom Permalinks’ tags. However, this fails in case you want to have permalinks that a plug-in should recognize and redirects you to the WordPress 404 page.

For example, if you have a page called calendar accessible via http://my-website.com/calendar which is essentially a page that is generated via a custom template or a shortcode, a URL like http://my-website.com/calendar/2010/march will lead to to a 404 page. The easiest solution to avoid this is to have a URL like http://my-website.com/calendar/?year=2010&month=march which given the rest of your website will look plain ugly.

We can however use the WP_Rewrite class and extend the set of rules that WordPress processes to ensure that our rule is processed like we want it.

We recently used this for one of our websites which you can view here Australian Shephard Dog Breed or Beagle Dog Breed

Popularity: 13%

Tracking online status

This post was created on April 29th, 2010 by Sudhanshu and has 0 comments. It has been filed under , ,

This is not about tracking your status on the plethora of social networking sites, rather about checking up if our internet connection is still active!

We have been using a data connection from Reliance for quite some time, but the connection keeps failing quite frequently during summers. We wrote a script on our local servers to keep connecting us to the ISP’s servers whenever they log us out, so we thought of using that information to create a Online Status Tracker for our office. Here is what it looks like:

Not only does this provide a status, it also gives us an update on what is the latest status if the connection is being initiated, or if their login page isn’t loading (which happens quite frequently).

Having an undying internet connection would be really cool, but till Reliance decides to get that in place, all we can do is enjoy our little tools.


Popularity: 11%

Browser Compatibility Check for Internet Explorer Versions from 5.5 to 8

This post was created on March 29th, 2010 by sribanta and has 0 comments. It has been filed

IETester is a free WebBrowser that allows you to have the rendering and javascript engines of IE8, IE7 IE 6 and IE5.5 on Windows 7, Vista and XP, as well as the installed IE in the same process. It’s now possible to have multiple versions of Internet Explorer installed in parallel and running concomitantly on the same Windows operating system.

With IETester, the testing process is streamlined to a maximum, as the solution offers tabbed capabilities, permitting developers to open a website into various versions of Internet Explorer 8 across multiple tabs.

This is still in alpha stage. Some of the download links are

1.  http://www.my-debugbar.com/wiki/IETester/HomePage

2. http://www.softpedia.com/get/Internet/Browsers/IETester.shtml

Requirement : Windows 7, Windows Vista or Windows XP with IE7

So download it and enjoy IETester.

Popularity: 13%

When you get some time off make some wallpapers!

This post was created on March 10th, 2010 by abhinit and has 0 comments. It has been filed under , , , ,

Between frantic coding sessions, making sense of emails, staring at the screen and chasing tyrannosauruses around the Office I get sometime off. When that happens, I launch Pixelmator, make sure no one around is paying any attention, and make wallpapers.

Here are some of them. Most of them took a few minutes to make. No, really!!

PS: Pixelmator is an awesome image editor.

Popularity: 18%

Open up your Mac Mini!

This post was created on February 5th, 2010 by Sudhanshu and has 0 comments. It has been filed under , ,

Among the many joys of running your own company, a certainly interesting one is the ability to open up stuff once the hardware stops working.

A weird accident yesterday left our Mac Mini a little zonked out and it just refused to power up. When there was no hope left that we would see it working anytime soon (The Apple Store takes 4 days to update an OS, this would have certainly taken up a month to fix), we decided to open this thing up. I realize that a hundred thousand people have done this before, but this was certainly the first time we opened up the little monster.

Here is what it look like, once you open it up.

Not that any good came of it though (we’re looking for somebody who can fix it now!), but we were able to appreciate the inner beauty of tiny piece of hardware evolved by Apple. Maybe it will provide the inspiration for us to do something that has never been done before.

Popularity: 20%

Push Notifications in your iPhone App using PHP and Ubuntu

This post was created on February 3rd, 2010 by Sudhanshu and has 1 comment. It has been filed under , , , , ,

Push Notifications have been around for quite some time now, but when we started on it, we found out that we were unable to find all the information about creating a demo in one place. After a few hours, we were able to get it to work. Here is what we did.

Basically, the code on your server needs to talk to the Apple Push Notification Service (APNS) to send the messages, and the APNS then delivers them to your phone. We will only provide the code level details here to help you carry out the same on your server.

Basic Idea

You need to do the following to get your application to send push notifications

1. Make your application accept Push Notifications
2. Create a SSL certificate for your server which will allow it to talk to the APNS
3. Create the payload for each message to be send to the APNS
4. Send all the payloads one by one to the APNS

Even if you have already been into iPhone development for sometime, you might not be aware of the ‘DevToken’. This is a uniquely generated token for your iPhone application on a particular phone. It can keep changing over time for a particular phone as well, but it is the unique id that will help you send a message to a particular application on a particular phone.

This is what it looks like on our phone

4d3d32e4 c1beebd2 f3a6bc85 3f7d12b9 abc156b4 26818ecf 9673a712 85e01adc

This is what you need to do to get your device token.

Getting the certificates in place

Reach for your mac and start doing the following

1. Login to the iPhone Developer Connection Portal and click on App Ids.

2. Create an AppId for your application witouth a wildcard. It should be something like this :

com.vxtindia.PushSample

3. Click configure and then go ahead and create a certificate for Push Notifications.[1]. Download it once it has been created.

4. Import the newly created certificate into your keychain by double clicking it.

5. Launch ‘Keychain Assistant’ and filter it by the Certificate’s category. There you should see a ‘Apple Development Push Services’ option. Expand it, right click on it and click on ‘Export …’ and save this as apns-dev-cert.p12 . Also download the private key as apns-dev-key.p12

6. Copy the file apns-dev-cert.p12 to your server in the folder where you will put the rest of your PHP code.

7. Now run the following code on the server
openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12

We are running everything from a server running Ubuntu-9.04. Here we had to remove the passphrase, which can be done as follows
openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem

Finally, combine the two to get your apns-dev.pem file
cat apns-dev-cert.pem apns-dev-key-noenc.pem > apns-dev.pem

8. You need to create a payload and send it to the APNS server. You can use the following code to do so

9. Great work! You have just pushed a message to the APNS which will now be delivered to a phone running your application.

10. (Optional) Apple also provides a Feedback service (which doesn’t do anything that you would expect). This service tells you when was the last time that APNS failed to find your application on a specific phone. When this happens, you need to stop sending updates to that Device Token.

To assist you in your endeavors, here is the code to help you read this data

That’s it. You are now officially a pro at push notifications!

References :
1. Apple’s Documentation
2. BoxedIce

Popularity: 100%

ConnectingIndia has a new address

This post was created on June 18th, 2009 by Sudhanshu and has 0 comments. It has been filed under , , , , , , ,

Connecting India

Connecting India is a Pune based NGO dedicated to suicide prevention in youth. Its team of dedicated volunteers and concerned citizens are dedicated to serve the community through its various programs, seminars and especially through its Suicide Prevention Helpline to support individuals dealing with emotional stress.

Connecting India was starting a number of new initiatives and wanted a new website which would reflect the dynamism in the organization. We working in collaboration with Stradicate to help create the new design and interface. Stradicate worked on the design and we developed and hosted the website.

If you would like to make a difference, and you are above 21 years of age, please get in touch with Connecting India on +91-20-26333044. Their helpline operates from 2pm to 8pm and they also provide training to volunteers who qualify for the program.

If you are an NGO and are looking for a similar solution, do get in touch with us.

Popularity: 17%

Another iPhone application reaches the App Store

This post was created on June 11th, 2009 by Sudhanshu and has 0 comments. It has been filed under , ,

fruition-on-app-store

Our second iPhone application is now live at the App Store. We worked with Iterating on this one, and after a few months of hard work, it has finally reached the AppStore.

More details are available on the Iterating Blog and it can also be seen on the App Store.

Even though the app is free, the only catch is that you need to own a few vineyards to actually use this application!

Popularity: 17%

Get emails from SVN on commit

This post was created on June 3rd, 2009 by admin and has 1 comment. It has been filed under , , , , , ,

We have been using SVN for a couple of years for all of our projects. Initially we were hosting them at Springloops.com for almost a year, when we decided to start hosting them on our own server.

It all sounded really good, till we realized that code reviews became a real problem. Springloops had a stunning interface to compare the diffs and get all the related information, which we really missed.

So we decided to use the post-commit hooks in SVN to email us as soon as a commit was made.

If you would like to implement the same for your server, here is a quick and dirty guide on how to do that.

First, the details about our server

# svn --version
svn, version 1.5.1 (r32289)
compiled Jul 31 2008, 09:45:20

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 8.10
Release: 8.10
Codename: intrepid

Okay, so let us get started. The first thing that you should know is that inside your repository, SVN creates a folder called hooks. This folder initially contains template files for all the hooks that can be called via SVN. The hook that we are after today, is called post-commit.tmpl

Since our language of preference is PHP, we decided to call a php script as soon as a commit was done on that repository. Here is how we did it

# cd /path/to/repo/hooks
# mv post-commit.tmpl post-commit
# chmod 755 post-commit
# vi post-commit

The post-commit file contains the following

#!/bin/sh

REPOS="$1"
REV="$2"

php /svn/scripts/postCommitHook.php $REPOS $REV

The above steps can also be automated by writing another php script which would copy all our hooks from a base directory into the respective directories in the repositories. Here is what our script looks like

Finally, we need to create the file postCommitHook.php which will find out all the relevant information and mail you the details. We have used svnlook and phpmailer to get all the information. Here is what our postCommitHook.php looks like

And that is it!

Once the scripts are in place, just run copyHooks.php once and then whenever anybody commits on any of your repositories, you will get an elaborate email with the diff.

Popularity: 19%