Securing your downloads with PHP and mod_xsendfile
It's quite usual to see people sending secure file downloads using either readfile(), fpassthru() or similar. However, this approach for larger files can be troublesome because it goes through the PHP process using higher memory, relies on a high execution time and is slightly slower.
Enter Apache's mod_xsendfile.
Bristol IT Mega MeetOn Saturday Gravitywell attended Bristol’s first IT MegaMeet, a conference that brought together 20 of Bristol’s user groups. Over 200 delegates attended mainly made up of web developers, programmers and students. Here is a selection of just some of the user groups involved...
Wordpress: create a custom ShortcodeFollowing on from my last blog post i decided to create a custom Shortcode utilising the Shortcode API. I needed one which wrapped content such as a pages content (this is known as self enclosing) as opposed to a standalone enclosing Shortocde.
Magento: Removing links in the navigation block by name or by label
Sometimes in Magento you may want to remove links from the customer navigation block. What you'll notice is it's actually quite hard to do so because there is no 'remove' method.
In this tutorial I will show you had to extend Mage_Customer_Block_Account_Navigation to include an extra two methods, one to remove links by name and the other by label.
Wordpress Shortcoder plugin: Create a Twitter widget ShortcodeIn this blog post i will show you how to create a Twitter widget Shortcode using the Wordpress Shortcoder plugin. This excellent plugin for Wordpress enables developers to create custom Shortcodes quickly and easily.
How to set up Ctags for Sublime Text Editor 2
"Use the Source, Luke"
Ctags is an excellent plugin for Sublime Text Editor 2 for giving you Jedi like powers. It enables you to jump through function calls to their definitions in the source code saving you a whole load of parsecs in file navigation.
Setting Ctags up is easy, here's how to in linux...
Some handy tools for optimisation
"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil"
There are a raft of tools now available to help a developer to optimise a modern web application: either providing pointers for improvements and modifications of the code or changes that can be made directly to the server (such as enabling mod-spdy). Here are a few that I've found helpful:
Webkit's brilliant inspector
Webkit's inspector is a tool that every developer will likely have to hand, but that many won't know how to use to its full potential. The audit, network and resources panel can be a real help in optimising sites. Majd Taby has recently Read more... [Post Comment]
Sublime Text Editor 2Sublime Text Editor 2 is a favourite here at Gravitywell for developing Web Applications and here's why...
Wordpress: Version 3.3.2 and Beta 3.4
The PHP CMS Wordpress has a new revision available. Revisions include security updates to 3 external libraries...
Extending the Magento API
As UK Magento Developers we often find the need to extend the Magento API. This is actually quite easy to do.
In this article I will show you how to take the sales order API and extend it to automatically capture any payment when an invoice is created through the API.