Mcloide's resources library

A whole bunch of ideas, concepts, PHP development and so on.

Archive for the ‘resources’ Category

PHP Extreme Odd situations

Posted by mcloide on June 22, 2009

A friend of mine just sent me this site – http://www.phpwtf.org/. It’s insane good. Shows some good situations of when PHP leave you wondering WTF (sorry no better way to describe this).

Here is a great example from it:

<?php
// I just need four NULLs to demo this.
$a = array_fill(0, 4, NULL);
$a[0]++;
++
$a[1];
$a[2]--;
--
$a[3];
var_dump($a);
?>
and this is the result
array(4) {
[0]=>
int(1)
[1]=>
int(1)
[2]=>
NULL
[3]=>
NULL
}
If you want to see the full article and some more info about this particular issue, visit: http://www.phpwtf.org/

Posted in PHP, cool, development, resources | Tagged: , , , | Leave a Comment »

Authorize.Net AIM Class Version 2

Posted by mcloide on June 12, 2009

After some good responses from the previous class, I took some time and have done some minors, but necessary updates on the class.

Please note, this current version of the class still in Beta release (since the file_get_contents has not been tested and passed under QA)

Here is a list of the added / updated features of the class

  • Added __set test before posting the call to the gateway
  • Added constants method for those who does not use Zend Framework (extra parameter on the class, but it covers the logic for both methods)
  • Both previous items a good thanks to: Ram
  • Added posting via file_get_contents (not tested)
  • Added more info and better code compliance

To download the newer version of the class all you need to do is go to: https://sourceforge.net/projects/authorizenetaim/ - the download instructions are there.

If you have tested the class, let me know what you think. Improving always.

Posted in PHP, Zend, development, resources | Tagged: , , , , | Leave a Comment »

Test mail server tool

Posted by mcloide on May 26, 2009

The main reason why I have created this blog was to keep all my resources and libraries at one place and share them with every developer on the web.

Today I found out that one good resource that I have used for a while was not blogged. The test mail server is a simple application that will take over your mail server locally so you can fully test your applications (basic mail config). If you are developing on Windows, that’s a must have tool.

I have added the link on my Resources page, but you guys can see the original post at: http://www.tiredrobot.com/2008/11/03/test-mail-server-tool/ .

Note: This is a great blog that have the same concept that this one (that I helped and help until today), but a bit older, so you can find more stuff like this and a lot more stuff for Flex programming.

Have fun.

Posted in PHP, development, resources | Tagged: , , , , | Leave a Comment »

Fix for the Xubuntu VPNC killing internet connection

Posted by mcloide on May 6, 2009

I have been strugling with this issue for the past 2 days. After updating Xubuntu 8 to the 9th core, the VPNC started to act different from what it was before and every time I have connected to the VPNC it was killing the connection for the Internet.

I was discussing this with a friend of mine, much more experienced with Linux, and he told me what was going wrong.

The VPNC removes the default route that connects you to the INTERNET, connecting you only to the private network. If you want to have both of worlds at the same time, you will need to add a new route to the VPN.

Doing this by the GUI is extremely annoying so he did sent me a good article teaching how to do this using the command prompt.

Go to: http://www.gentoo.org/doc/en/vpnc-howto.xml and go more specifically to the #7 item.

Follow what is being told and you are good to go.

Just a note, you need to be a route for that, so use the sudo command to help you out.

Posted in linux, resources | Tagged: , , , , , , | Leave a Comment »

Simple Clearing of Floats

Posted by mcloide on April 30, 2009

Cool tip:

Got this from a friend of mine today. Is very simple and it does work on most of browsers.

” When you have two floated elements inside a container element, instead of adding a clearing DIV before the closing of the container element, you can try adding the following two CSS properties to the container:

display:  inline-block;
overflow: auto;

Tested this and it worked on IE 6, IE 7, Firefox and Safari.

Source of tip: http://www.sitepoint.com/blogs/2005/02/26/simple-clearing-of-floats/ (display: inline-block is not mentioned here, but I found it is needed for IE 6). “

Posted in CSS, cool, development, resources | Tagged: , , , , | Leave a Comment »

Tracking mobile with Google Analytics

Posted by mcloide on April 22, 2009

I’m working with mobile for a while now and today the question poped: how to track mobile with Google Analytics.

At first it did not make much sense, but most of the mobile devices does not support Javascript or Cookies.

After some googling on the net I came accross this post – http://www.vdgraaf.info/google-analytics-without-javascript.html – that shows a way to call the tracking from Google without Javascript.

I have just did a small test run in my website: http://www.mcloide.com and tomorrow I will post the results for you guys here.

Anyway is a great post and if you are having the same difficulties, this might help you out.

Have fun.


Update:

I have just checked the analytics for my site and it did correctly got the Blackberry, Nokia N90 and the Sony Ericsson. I have only one entry for Safari, so I guess that was for the Iphone string (it shows Iphone on the operating systems part).

All the entries shows the fake url (that’s how it was instructed at the blog) and the IP of origin. It also shows 100% of bounce rate.

It definitively works. I will keep it on my site for a long time track and see how things are going and anything new I will post a new update.

Posted in PHP, development, google, resources | Tagged: , , , , | Leave a Comment »

RapidSVN can’t unlock local directory

Posted by mcloide on April 22, 2009

This is a common error, it seems, whith RapidSVN system. RapidSVN is very good, but some times, when this happen it get very anoying since you can’t unlock the dir even when setting the force option.

Today I got this issue again. One of the repositories that I was working with got stuck in a lock mode that I don’t know where and how it happened and I could not unlock using the RapidSVN.

Goggling around the net I couldn’t find anything, so I have downloaded subversion (sudo apt-get subversion) and tried to unlock using subversion. It did not work, but, it did give me at least some clue of how to work out.

This is how you need to do if you got stuck with this:

  • Download and install subversion: sudo apt-get subversion
  • Cleanup the repository: svn cleanup /path/to/repository/dir/

This should go nice and easy, but pay attention if you got one or another message from it.

After the second command you should be able to correctly update your local repository.

Posted in development, linux, resources | Tagged: , , , , | 3 Comments »

Javascript LIbrary Detector

Posted by mcloide on April 13, 2009

I was scooping out a blog from a friend of mine today, Smooka Blog, and I found this interesting post from a Firefox plugin for detecting Javascript libraries. It’s useful in many ways since you can learn if your project have correctly loaded the library or what library does the site that you are visiting have.

Anyway, cool post, check it out: http://www.smooka.com/blog/2009/03/26/javascript-library-detector/#more-52

Posted in Javascript, development, resources | Tagged: , , , , | Leave a Comment »

Build Apps for smart phones with a framework

Posted by mcloide on April 8, 2009

I’m not fond of Ruby on Rails, but this can be a great resource - http://www.rhomobile.com/ – even more today with the hunger for mobile apps becaming every day bigger.

This guys had done a framework that would provide you create a app for multiple smart phones with one single code.

It’s a pretty cool concept and it’s definetly worth to take a look at.

Down side: It’s not PHP, but well, nothing is perfect :)

Posted in News, development, resources | Tagged: , , , , , | 1 Comment »

Authorize.net PHP5 Class – Update

Posted by mcloide on April 1, 2009

I have decided to place the download inside SourceForge.net. There I can easily mantain notes, logs, and better organize versions and files.

To check the new Authorize.net download page, please go to: https://sourceforge.net/projects/authorizenetaim/

Keep your eyes open I might be releasing some more changes soon :)

Posted in PHP, Zend, development, resources | Tagged: , , , , , , | 4 Comments »