Tag Archives: tutorial

File Upload Progress in PHP 5.4

With the release of PHP 5.4 the file upload progress feature becomes available. Yes, “available” as in “you can use it in your project now”.

PHP 5.4 File Upload Progress

This is a quick start guide with the least amount of code required, using jQuery’s compact AJAX requests and iframes.

Continue reading

Generate WordPress Posts From Fan Mail

Whenever I dig around the WordPress source code, I try to come up with crazy functionality ideas and scenarios that at least one person in the world might find useful, write them down and come back to them and write some code whenever I feel like relaxing and having a bit of fun. Today is one of those days.

Generate WordPress Posts From Reader Fanmail

In one of my last week’s posts titled Another 7 Overlooked WordPress Helper Functions, I mentioned the POP3 library that is bundled with WordPress as something one can use.

Useful for all sorts of interesting things, like parsing reader fan mail to draft posts automatically, answering them and publishing them.

Continue reading

VIM Scripting with Python: Lookup IP Country

I’ve been playing around with VIM scripting today, experimenting with a very small and limited portion of VIM’s full capacity. VIM scripting is powerful, however one is able to leverage the power of built-in and external Python libraries instead. Imagine coding an XML library in VIM script, it’s time consuming and error-prone. To make the article a little more fun, I’ll code up a simple VIM script that looks up a country for an IP.

VIM IP Lookup in Python

This mini-tutorial assumes you know the basics of VIM – movement, modes, buffers, windows, etc. I’m also going to assume that you’re using a terminal version of VIM.

Continue reading

Surviving An Internet Blackout

When The Internet Goes Down

On the 12th of February an Anonymous posted the following pastebin: Operation Global Blackout. In case the pastebin disappears here’s the plaintext: Operation Global Blackout Anonymous.

To protest SOPA, Wallstreet, our irresponsible leaders and the beloved bankers who are starving the world for their own selfish needs out of sheer sadistic fun, On March 31, the Internet will go Black.

Continue reading

How To Setup Multiple IPN Receivers in PayPal

Instant Payment Notifications (IPN) allow your applications to receive notifications from PayPal on payments made. This means that your application can fulfill an order automatically upon receiving such a notification. However, when you get your second application up with its own IPN you suddenly find out that PayPal lets you set only one Notification URL.

Of course there’s the whole notify_url charade and counterparts for all of PayPal’s APIs, but, unfortunately, there are cases when you simply can’t get to set those:

  • Plugins that are hard-coded, where you can’t alter their core and they just force you to set the URL, so you end up locked in; this may be true for all sorts of applications in all sorts of languages (especially true for compiled ones)
  • Third-party billing services like e-Junkie, Kajabi, 1shoppingcart and many others, they just lock you in, and tell you to set the IPN in PayPal
  • Subscriptions and Recurring Payments; yep, PayPal does not allow you to bind a specific IPN for subscriptions at all (let me know if I’m incorrect, but I’ve spent days looking at the manuals)
  • Multiplexing one IPN to two or more sources, for synchronization, custom alerts etc.

For everything else, modify your forms and API calls to include the notify_url attribute.

Multiple Notification URLs in PayPal

The easiest and most straightforward solution would be to get multiple PayPal accounts, right? Right, BUT:

No Multiple Accounts. Should you register for more than one Personal Account, PayPal reserves the right to terminate all of your accounts and will restrict you from the system going forward. Users may register and hold one Personal Account and either one Premier or one Business Account.

…from PayPal’s Terms and Conditions

So unless you have a separate legal business entity (company) for each Business Account), you’re out of luck. However, there a simple and sweet way to overcome this single IPN URL business – receive IPN and broadcast it.

Continue reading