NetBeans, Codeigniter and debugging with XDebug in MAMP

I just started testing Netbeans and after I got the code indention work as it should (took about 3 hours and still couple thing’s I don’t like) and got the autocomplete working on my own models, I found this awesome tutorial by Leonard Teo.

I was trying to make supershort example how to enable this on MAMP but looks like it wasn’t that easy job icon wink NetBeans, Codeigniter and debugging with XDebug in MAMP Here’s couple simple steps to enable XDebug on MAMP:

PHP

  1. Open php.ini (Applications:MAMP:conf:apache:YOUR PHP VERSION, example php5.2)
  2.  Uncomment line: zend_extension=/usr/lib/php5/20090626/xdebug.so
  3. Add next 4 lines after the previous line:
    xdebug.remote_enable=on
    xdebug.remote_handler=dbgp
    xdebug.remote_host= localhost
    xdebug.remote_port=9000
  4. Restart apache

NetBeans

  1. Open Project Properties (right click your project)
  2. Select Advanced on “Run Configuration
  3. Set “Do Not Open Web Browser“ and click OK.

Chrome or Firefox

  1. Install Xdebug helper
  2. Open Xdebug helper options and add there your local development domain.

I’ve only tested this on Chrome, so now you should see Xdebug helper icon on address bar on your local development domain. By clicking it you can enable the debugger.

How to debug

  1. Add break point on the line you want to debug in NetBeans
  2. Start debugging on NetBeans (Debug -> Debug Main Project)
  3. Go to the url you want to debug with your browser
  4. Go back to NetBeans and click Debug -> Continue untill you find your Break point etc…
Posted in Codeigniter | Tagged , , , | Leave a comment

OS X Terminal and SSH Keep Alive

If you problems keeping your SSH connections live with Terminal (free wireless in coffee shop etc), here’s easy fix for ya icon wink OS X Terminal and SSH Keep Alive

Create SSH config file from Terminal if it doesn’t exists:

nano ~/.ssh/config

And add text below to your new config file:

ServerAliveInterval 10

And that’s it!

Posted in OS X | Tagged , , | Leave a comment

Codeigniter and Page Title helper

I spend all day wondering about this encoding stuff as PHP has many functions what are not UTF-8 compatible, or at least don’t return UTF-8 data. So I tried to fix all these weird chars with different encode and htmlentities approach but 3 of my servers were showing whole different hieroglyphs and special chars were still acting a bit weird.

Keeping long story short, the fix was to do some HTML entities magic before DOMDocument. Maybe with your server it’s not necessary? Who knows… Anyways, here’s my approach to get page title with php.

You can find my helper in github.

Updates:

Updates:
- Not so well formed HTML should not take over your error log anymore (libxml) smile Codeigniter and Page Title helper
- Added multiple user agents to curl
- Added browser headers to curl
- Helper now follows redirection
- Now it removes whitespace around title

With headers and user agent in curl, now it returns title from sites like Facebook also.

Posted in Codeigniter, Coding | Tagged , , , , | Leave a comment

Spotlight not working in OS X Lion? Read the fix

My Spotlight started giving poor results recently and after some Googling I find out that you can reindex Spotlight by typing sudo mdutil -E / to Terminal window. For some reason I got error message “Indexing disabled.”. Fortunately there’s a easy fix, just type sudo mdutil -i on / and it should start reindexing your hard drive immediately.

Posted in OS X | Tagged , , | Leave a comment

Photoshop and transparent background in OS X

There’s tons of ways doing things in Adobe software and sometimes it’s just hard to find the answer to most basic question. Here’s a tip for users who may be as stupid as I am and have a hard time figuring out how to enable the grey background in Photoshop instead looking the desktop all the time in that disturbing transparent background.

It’s not in the program settings as where I have been trying to find it, and it’s not the F option either (if you want to work with multiple images). It’s in Window menu and the option is called “Application frame”. Just enable it and there you go.

Posted in OS X, Software | Tagged , , , | 4 Comments

Firefox 5 getting slow on OS X?

After latest update, this fix and many other fixes doesn’t seem to work anymore, Firefox has gone from bad to worse, with all of my family computers. So this not may be helpful for you anymore… Also OS X Lion seems to have some serious issues with wireless networks. 

Firefox 5 seems to have some performance issues with many mac’s (Even page scrolling was almost impossible with Macbook Air) but looks like some one found the fix here.

Basically you just type about:config to adress bar, search and double click for network.dns.disableIPv6 = true and restart your browser.

There’s some information at Mozillazine.org about this issue:

“Under certain versions of Mac OS X (those prior to 10.4), this bug is compounded by another bug wherein the OS still makes IPv6 DNS requests even if IPv6 support is disabled. A significant delay is introduced in all connections requiring DNS lookups while the OS and the DNS server exchange unnecessary (or redundant) queries and responses to resolve the address. ”

Edit: This didn’t fix the problems with https pages but looks like that everything is back in order after updating to Lion and installing latest updates and doing some other stuff like creating a new user account to OS X. That’s another week what I’m not going to get back ever icon wink Firefox 5 getting slow on OS X?

Posted in OS X | Tagged , , , , | Leave a comment

WordPress and image quality

I haven’t actually noticed before but image quality in WordPress sucks big time with thumbnails and medium size images. The big versions are ok because they are just resized from originals. With thumbnails it does somethings stupid, don’t know why though. If someone find’s easy way to fix this rather than create thumbnails in Photoshop, I would be happy to know about it.

Btw, I’m currently in some kind around the world trip, currently writing this post at hotel in Orlando. Next stop is going to be Palm Bay, then some cruise on Caribbean, after that Miami-beach, San Fransisco, Los Angeles, Honolulu, Auckland and that’s for starters… don’t know when going back to Finland if ever icon wink Wordpress and image quality Travel blog (in Finnish) can be found here.

Posted in Internet | Tagged , , , | Leave a comment

Helsinki celebrating 2011 Ice Hockey World Championship Gold!

I had my camera with me last night, here some footage icon wink Helsinki celebrating 2011 Ice Hockey World Championship Gold!

Posted in Video | Tagged , , , , , , | Leave a comment

CKeditor 3.5.3 and align images instead of float

CKeditor is a great tool for editing HTML Emails but image dialog is a bit tricky because it uses float instead of old fashioned align. That’s not good thing for Email applications because of their crappy CSS support. I think I’ve managed to change everything in Image Dialog (CKeditor 3.5.3) to old fashioned HTML.

My fix includes:

  • align
  • width
  • height
  • border
  • vspace
  • hspace

You can find my image plugin here (Orginal rows are commented out).
Updated image.js 4.5.2011

Posted in Coding, Internet | Tagged , , , , , , , , , , , | Leave a comment

Easy fix to fgetcsv and newline character

Looke like there are some problems with PHP’s fgetcsv function and newline characters when it comes to Excel created in OS X. Fortunately there is an easy fix. Just set php ini auto_detect_line_endings = true before you open the file.

Example:

ini_set('auto_detect_line_endings', true);
$file = fopen($p_Filepath, 'r');
Posted in Coding | Tagged , , , , , | 3 Comments