Posted: 2012-04-21
Category: Code snippets
I'm a devote Doctrine 1.2 user but times are changing and now I'm faced with the challenge of learning and updating all of my applications to use the brand new Doctrine 2.2 framework.
Doctrine 2.2 has been completely renewed and a lot of cool stuff from Doctrine 1.2 has dissapeared, one that will be missed the most I'm sure is the auto-magic the behaviours provided, this said some new challeneges arise, for example, what type of data to use to store basic data like latitud and longitud since the Geographical behaviour is now gone.
A solution I've find is to use decimal type of data with a size of 18,12, so if you are defining your models with YAML like I do you can do the following:
EntitiesCity:
type: entity
fields:
id:
type: integer
id: true
generator:
strategy: AUTO
name:
type: string(255)
latitude:
type: decimal(18)
scale: 12
precision: 18
nullable: true
longitude:
type: decimal(18)
scale: 12
precision: 18
nullable: true
With this type of data I fixed my need of storing latitude and longitud data.
Posted: 2012-04-09
While trying to update a certificate on a produciton enviroment I ran into the following issue, Apache only accepts certificates in PEM format, since my client provided me with his new certificate on a .cer file I had to find a way to convert it.
For x509 certificates this can be easily achieved using OpenSSL on Linux/Unix and OS X. First make sure you have OpenSSL (comes by default with OS X), open a terminal and issue the following command:
openssl x509 -inform pem -in certificate.cer -outform der -out certificate.pem
Where certificate.cer is the source certificate file you want to convert and certificate.pem is the name of the converted certificate.
Posted: 2011-12-03
Hi there guys,
I've detected a fraudulent twitter application spreading with the name "Twitter+ Plus" (T+ en Español) url:http://we.usetpl.us/ which ask users for access to their accounts, after being authorized it returns the users to twitter.com so I thought I might share this with you.
My motive to think this app is a scam is that the callback address points to a server with only 2 scripts (http://67.23.166.168/~tb/
https://twitter.com/#!/liz_
Hope you can use this information sort out the issue so I dropped an email to the guys at twitter hoping they'll do something with that.
Please share your thoughts on the comments.
https://twitter.com/#!/search/
Posted: 2011-09-19
Category: Code snippets
It's been a while since it started coding again in PHP specially in PHP 5.3.0 and I've come across some interesting finding, for example some functions such as ereg, eregi and split are deprecated now in favor of a new library call Perl-Compatible Regular Expressions. For old coders (like me) we need to start updating our code to keep with the up to date standards.
A function I use a lot (for good or for bad) is split but as a matter of fact is one of the new deprecated functions on php so instead of calling it as usual (delimiter, string) now we have to call it using a perl-compatible regular expression (regex,string) as follows...
Posted: 2011-09-12
Category: How to's
Often while I'm administrating a Linux/Unix box I come across the tediousus task of freeing up space on the server, usually this task is easily accomplished by issuing a simple "ls -lh" command, you get a nice listing of the files in the current directly along with some nifty details like last modification date and size (the -h parameter for ls allows us to get the size in a human-readable way).
The downsize of doing it this way is that you don't get to know for real the size of the folders within the current directy, you get a nice total on top of the "ls" listing. A nice command to get the size of a certain folder is issuing a ds
du -sh folder/
Posted: 2011-06-26
Category: How to's
At the time of writing this post I must say that I feel like a hero! That feeling is wonderful you know, when someone has a problem with their computer and not a simple but a HUGE one and you are able to repair em you turn to be that people hero.
Today my friend Avaco12 made a little mistake while installing bootcamp on her iMac, she left her external (200GB) disk connected, and when Windows asked her where to put the new Partition she accidentally selected her preciousus external drive, when she realized it was already too late, windows had already destroyed the partition table on her disk. She had 1 HFS parition and 1 FAT. She was crying because she said she had her entire life on that disk, so she asked me for help and I started researching what could I possibly do to repair the disk or at least retrieve her data.
Posted: 2011-06-26
Category: How to's
I don't want to sound mean but, God, MSDN API sucks =P. Not because it doesn't tell you the stuff you need to know but because it requires alot of imagination from you to understand it.
For example, I was looking for a way to kill a process using it's process id ( PID) however it turn that when you are programming for WIN32 you need to use HANDLE's for everything so if you'd like to have a process that creates process and then kill them you'd have to store and manage every handle.
Posted: 2011-06-26
Category: How to's
That was a long title for this post o_o. Well , I first must clarify that my blog is not a wordpress mod, however it doesn’t mean I don’t have to work with wordpress at some point in the day. Recently I was doing a newsletter for a Website and I decided I would parse the RSS from that website to get the 4 newest contents however I ran into a trouble while using PHP’s SimpleXML class and this was that I SimpleXML couldn’t parse the contentn since it came with what is called namespace. For those of you who only came in here for the solution here it is =)
Posted: 2011-06-26
Category: How to's

Coda is by far most the best Developer Tool I've ever used on a PC or a Mac. It simply concentrates all you need to develop web on a simple and cute window. Some of it's features that I like are the auto-completation, Multiple Site management, Preview , CSS Editor a syntax highlinting.
Posted: 2011-06-26
Category: How to's
Today I had a hard time creating a regexp to match domains on a string. I wouldn't like the internauts who visit this small blog to suffer the same pain, so here's how to :
var StringWithData = " asd http://subdomain.perrohunter.com/lol/something.php asd";
re = /http://w+([.-]?[a-z]+)*.com/;
var results = re.exec(StringWithData);
alert(results[0]);
Posted: 2011-06-26
Category: Tweaks
Man I like Safari :( It's a really cool fast/light/powerful/beautiful/all-the-last browser. I only got 1 small problem with it... THE KEYBOARD SHORTCUTS SUCKS ! I'm really used to Mozilla's friendly tab navigation , with Command-#number I can go right into the tab I want to, with Ctrl-Tab I can change from one tab to another however with safari I gotta press Command-Shift-Arrow or Command-Shift-[ and this requieres me to use both hands BOTH HANDS, can you believe it?
Today with the amazing release of Safari 4 I was thinking in giving Safari a chance again. I gotta admit the new Safari interface got my eye. I think is way better than chrome and I just love it, I still have the same issue with keyboard shortcuts but then I thought "im using a mac, there must be a way" so I started checking here and there and found a small work around to personalize certain behaivours in Safari and I found a way.
Posted: 2011-06-26
Category: Applications
Sometimes I feel like iTunes is a little bit too demanding on system resources, it happends to me from time to time that I start feeling my Mac a little bit slow and then I check my ActivityMonitor.app and iTunes is eating up to 1.5GB of my RAM (out of my 4GB :P) that's alot of memory for a simple music player. After surfing the net for a nice solution I came across Ecoute.
Ecoute seems to me a really nice lightweit music player, the first thing that I like about Ecoute is that it plays your music right out of your iTunes library so you don't have to manage 2 librarys when syncing with your iPod/iPhone, I liked that since you only have to download this 3.9MB app unzip it, open and you are ready to go.
Posted: 2011-06-26
Category: How to's
I love administrating servers but when it comes to fulfilling my clients need I wish I had some magic software that could help me manage the server resources and everything. Well my iPhone does this ... nah I'm just kidding obviusly Plesk is the way to go since thats the title of this post.
When I found what was Plesk capable off I was amazed because it offers alot of features that can help you automate your bussiness however there is one thing that I don't like about it: "Plesk documentation sucks" literally. And i'm sure you agree with me and that's probably why you are here.


