Archive for the ‘Web Development’ Category
JS Popup Script Thing - Good For Thumbnails, etc.
Written by Chris on September 4, 2008 – 8:09 am -Just found this which is quite cool: http://highslide.com/
Wordpress version here: http://wordpress.org/extend/plugins/highslide4wp/
Popularity: 73% [?]
Sphere: Related ContentTags: JavaScript, Popup, Thumbnails
Posted in Cool Scripts, JavaScript, Plugins, Web Development, Wordpress | No Comments »
How to filter user submitted data easily in PHP?
Written by Chris on August 18, 2008 – 7:29 am -How to filter user submitted data easily in PHP?
Posted using ShareThis
Firstly, as you can see this is my first post made as a direct result of using the ShareThis bookmarklet, which is pretty neat as it actually worked
Secondly and more importantly, I wanted to flag this up on my blog as it's something that quite often gets missed in PHP which is actually a very powerful tool.
As the author of the post above mentions, array_map() can be a useful function when sanitizing user data, but it has so many more uses too when dealing with the transformation of a data-set.
Basically a call such as $new_data = array_map('process_data', $old_data); will allow you to transform each element in the $old_data array to a new element in the $new_data array via the function called process_data.
What's more you can manipulate multiple data-sets in this way too by specifying multiple arrays, so long as process_data() can take in the arguments.
For example lets say we have process_data($item1, $item2, $item3) which manipulates $item1, $item2, $item3 to produce a single result.
If we need to perform this calculation on a bulk set of data we can do
$new_data = array_map('process_data', $array_of_item1, $array_of_item2, $array_of_item3);
Easy huh?
I still see people performing these transformations, calculations, whatever, using for, foreach and while loops which can be prone to failure under certain conditions, and are probably less efficient code than simply making this call.
So why don't more people use it? I don't know, but maybe this post will help raise awareness!
Popularity: 67% [?]
Sphere: Related ContentTags: array_map, code, data, development, PHP, post, website
Posted in PHP, Web Development | 1 Comment »
Refactor My Code - I Wish I’d Thought of It!
Written by Chris on August 15, 2008 – 9:03 pm -refactormycode.com is a fledgling website setup as a project by French Canadian Ruby Developer Marc-André Cournoyer and basically it's like a coding forum without the usual forum junk, style and obfuscation of content (forums for me are always a pain to use because of the tiers of information you have to go through).
It's a great looking website covering all the current major programming languages (at least when thinking of the web) and the idea behind it, though simple, seems to work really well.
Basically, you have some code that works, but you want to make it better, more efficient, or just tidier. So, you post your code sample and other people suggest changes. It's kind of like yahoo answers for developers or the comments foot of the PHP manual.
The code to be refactored, so far in the PHP section at least, has been of a reasonable standard i.e. that of at least intermediate developers, which is great as these services can tend to get flooded by newbies who don't know their $i++ from their ++$i :p and rapidly lose interest for me.
So far there are only a few PHP samples on there to comment on but I think, as the site begins to grow, there will be a wealth of well developed and critiqued code that serves as good examples or directly useable functionality.
So far I can't really fault it, other than making the "Best" link clearer by calling it "Best Refactorors" or something similar, and providing some closed, or accepted answer(s) type functionality to stop a thread getting out of hand (it could be that this exists already but I just haven't seen it yet). Maybe even an option to download each refactoring as a plain text file could be useful.
So, to round up, as you can probably tell, I love this site and you can see my standing in the community in the foot of this page! Keep up the great work Marc and I hope your site develops in the way it deserves and gets the recognition it should!
Popularity: 96% [?]
Sphere: Related ContentTags: action, code, development, Flash, JavaScript, PHP, post, script, webservices, website
Posted in Flash, JavaScript, PHP, Web Development | 1 Comment »
MRemote - The Best, Free, Desktop Manager
Written by Chris on August 15, 2008 – 8:01 pm -When you have a number of different servers to administer (yes administer - administrate is not a real word!), all across different platforms, switching between different client programs can get very tiresome very quickly.
As a result there are a few programs out there that act as all in one clients for Windows Remote Desktop connections, VNC Connections, SSH, Citrix, etc. These can be REALLY useful in this situation and can save a lot of time and hassle while in some cases reducing the chance of user error when switching between apps.
We worked with a commercial tool, iShadow, for about a year, for this and soon realised its utility but although it was commercial, it was clunky and very very temperamental when it came to storing/loosing passwords and connection profiles. So we set out to find an alternative.
Thankfully, Kelvin, our Technical Manager found MRemote, a free, stable and nice to use client which does the job very well. Yes, it is basically an interface on top of a lot of existing open source client programs which it loads as components, but why re-invent the wheel when these things in their own right work, and work well?
So without raving about it much more, if you manage a load of servers and want to simplify the process somewhat why not give MRemote a go. The only thing I think it's missing, from my point of view, is an interface to the NX Client which I use on some of my machines, and maybe database servers such as MySQL, but aside from that it's fantastic!
Popularity: 94% [?]
Sphere: Related ContentTags: Administration, Citrix, Connection, Desktop, Open, RDP, Server, source, SSH, technical, VNC, Windows
Posted in Administration, CentOS, Linux, Microsoft, Servers, Web Development, Windows | 2 Comments »
PHP5 Universal File Download Class
Written by Chris on August 12, 2008 – 12:16 pm -After finding different hosting companies having wildly different policies when it comes to what's enabled and what isn't in PHP, I've built a generic file download class which should work in almost all situations.
This is the first version so there are some improvements to be made and if you download it, you'll see where some improvements may be made. I will be releasing another version when I've had time to do some further work on it. For now you can find the source code plus any community improvements here: http://www.refactormycode.com/codes/440-universal-file-download-class
I should also mention that this class has been cleaned of some application specific code, so if there's any disjointed bits I apologise - I have tried to deal with any discontinuities before posting but there may be something i've missed (this is also the reason for the bunch of if's in get_file() if you are to use this as is you may want to replace them with your own custom code).
Popularity: 82% [?]
Sphere: Related ContentTags: 5, Class, Download, file, PHP, script, Universal
Posted in PHP, Web Development | 3 Comments »















Feed 
