Canned Atropine!!

Navigation Menu

PHP equivalent of Rails' to_sentence()

Posted by on in iDevelop, PHP | 0 comments

So Corey popped a question last night in company chat room on whether WordPress has an equivalent of Rails’ to_sentence() function or not. The answer was no it doesn’t, & I thought heck that can be written quick!

Here is what I wrote quickly (and updated after that):

It can be further improved, the evaluation of three cases in switch can be removed entirely as demonstrated here.

Read More

Updating a cache automatically

Posted by on in iDevelop, PHP | 0 comments

A change that I pushed in iG:Syntax Hiliter v4.2 was that shorthand style tags were enabled for all languages. Apart from the GeSHi language files bundled in the plugin, you can add additional language files in the “geshi” directory of your theme and those will be picked up by the plugin. Since the architecture of the plugin relies on Shortcode API of WordPress rather than doing its own regex for tag parsing, the plugin always needs to know what language files are available to it to be able to allow shorthand style tags else the code blocks won’t get picked up by the plugin.

Read More

iG:Syntax Hiliter v4.2

Posted by on in iDevelop, iG:Syntax Hiliter, PHP, WP-Plugins | 0 comments

iG:Syntax Hiliter v4.2 is now available for download. Some bugs have been fixed in v4.1 and v4.2 along with a few new additions and improvements, some of which are:

  • Additional language files can be put in “geshi” folder inside current theme so that the files won’t get overwritten on plugin upgrade
  • Github Gist embed XSS bug fixed
  • Shorthand tags for all languages are now supported
  • A code block is parsed only once, subsequent similar code blocks in same post/page use the same output, for better performance

A more detailed changelog is available here.

Read More

Back from the dead.....

Posted by on in iDevelop, iG:Syntax Hiliter, PHP, WP-Plugins | 2 comments

The last release of iG:Syntax Hiliter was about 7 years ago when v3.5 was released. After that I got side tracked with other things which staked claim over my time, the plugin didn’t have any show stopper bugs & it worked fine with subsequent WordPress updates. So I kinda didn’t feel like there was any need to update the plugin, which was one of the reasons it didn’t see any updates after that.

Read More

WordPress plugin activation/deactivation hooks.....

Posted by on in iDevelop, PHP | 2 comments

If you develop stuff on WordPress, chances are you’ll be familiar with the plugin activation and de-activation hooks. But should they be used? Or are they to be avoided? Now that’s a bit of a tricky question, as there are compelling reasons for both sides and not all are applicable to generic scenarios but deal with specific use-cases, so the decision to use them or not is subjective.

Read More

Setting up PHP Development environment in a Virtual Machine

Posted by on in iDevelop, PHP | 12 comments

I’ve been meaning to move my local development stack to a VM for sometime now. The hardware has come a long way and running a Linux server as a Virtual Machine with 1-2 GB of RAM allocated to it doesn’t break any sweat today. Setting up the development stack inside a VM has many advantages like you can mimic the production environment of your website/app, have more than one type of server environment on a single computer & OS, etc. I’m not going into details of it, everyone has their own preferences, running the setup directly on your computer has worked well so far & still works, so if you don’t feel like going the VM way then that’s cool too! 🙂

Read More

The need for speed!!

Posted by on in iDevelop, PHP | 0 comments

Paul Jones has posted the results of his benchmark on speed of different PHP Frameworks here. He has benchmarked four frameworks; CakePHP, Solar, Symfony and Zend Framework. The benchmark was fairly simple, just outputting a “Hello World” string without any bells & whistles of the frameworks involved.

Read More

What's important??!!

Posted by on in PHP, Serious Jokes | 0 comments

I’ve been away for quite a while from this part of world, mean that I’m writing here on this blog of mine after 6 months, well a day more than 6 months to be exact!! No need for explanations, everyone’s got life, I found mine as well!! 😉

But what I’m amazed at is that some people just don’t have it or are too much frustrated with their own lives that they just crib about everything else they don’t like!! One example can be seen at this CodeIgniter vs. CakePHP thread in the CI forums. While some people really said why they didn’t like CakePHP & what they found good or better in CI, some of the crowd didn’t miss a beat to give their piece of mind about how badly CakePHP sucks and some went even as far as enlightening us how Ruby on Rails, Django, Turbogears, Python etc. suck!!! 🙄 These are people who never do anything worthwhile and their life passes by without a blink. Comments like:

Read More

Which PHP Framework?

Posted by on in iDevelop, PHP | 20 comments

Which PHP Framework is right for you? There seems to be an uprising in the world of PHP frameworks ever since the formidable Ruby on Rails took the programming world by storm, catapulting the quiet Ruby domain into limelight!! Ever since, new PHP Frameworks of all sizes and shapes(slow/fast, bloated/neat, simple/complex, light/heavy, rawking/suckerfish) seem to be popping up now and then and a lot of them seem to be modelled after RoR aka Ruby on Rails.

Read More

Code for Fun!!

Posted by on in iDevelop, iG:Syntax Hiliter, PHP, WP-Plugins | 166 comments

Seeing me freak out at solving maths equations, my mom used to say that solving maths problems is fun once you get the hang of it. I thought that she’s just telling me that to finish up my homework, but I now understand because its not that solving maths has become fun for me but I’ve found coding & solving problems in there to be fun, which apparently some people don’t. So logically speaking, when you get going in something, it starts looking fun to you, whatever it maybe, be it solving maths problems or logical equations while coding or cooking!!

Read More