Android emulator delete an android virtual device

Filed Under (Others) by admin on 10-08-2011

Tagged Under :

Delete an android virtual device a.k.a AVD

Type this on the terminal

android delete avd -n name_of_device

Titanium mobile hide android title bar

Filed Under (Others) by admin on 19-07-2011

Tagged Under : , ,

Hide the android window title bar on Titanium mobile

var win_home = Titanium.UI.createWindow({navBarHidden:true});

Titanium mobile Error generating R.java from manifest

Filed Under (Others) by admin on 19-07-2011

Possible cause you did not use the reverse domain name for the “–id” flag (i.e com.itlivewire.MyProject)

In creating your titanium mobile project “–id” should be in reverse domain format
e.g.

python titanium.py create --platform=android --android=/path/to/android-sdk --id=com.itlivewire.MyProject --name=MyProject

Titanium mobile create a project using command line

Filed Under (Others) by admin on 19-07-2011

Tagged Under : , ,

Create a titanium mobile android project using command line

titanium create --platform=android --android=/path/to/android-sdk --id=com.itlivewire.MyProject --name=MyProject

or

python titanium.py create --platform=android --android=/path/to/android-sdk --id=com.itlivewire.Myproject --name=MyProject

Titanium Mobile Fluid UI layout automatically arrange UI without setting top and height of views

Filed Under (Others) by admin on 08-07-2011

Tagged Under : ,

Problem: Setting manually the top and height of Titanium UI elements individually, just to arrange the Views to make it fluid or stack accordingly,

Solution:
On your main view add layout:’vertical’

var view = Titanium.UI.createView({layout:'vertical'});

Then on the UI you will add to the view add height:’auto’

var label = Titanium.UI.createLabel({text:'Test 1',height:'auto'});
var label = Titanium.UI.createLabel({text:'Test 2',height:'auto'});

Linux get the DNS of your pc

Filed Under (Others) by admin on 26-05-2011

To know what is the DNS server on your PC just type this in your terminal

cat /etc/resolv.conf

Webhosting Hostgator no mod rewrite codeigniter

Filed Under (Others) by admin on 01-05-2011

This is on hostgator and may apply also to other webhosting

When you access your codeigniter website like this

http://mywebhosting/~myweb

and you have mod re write enabled in your .htaccess

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /

    RewriteCond $1 !^(index\.php|public|tmp|images|captcha|js|css|robots\.txt|favicon\.ico)
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]

    SetEnv mod_rewrite_enabled 1
</IfModule>

But somehow it does not remove the index.php, so it is not working

To resolve this you have to add your webshosting username to the rewrite base

Instead of this RewriteBase / change it to this RewriteBase /~seodev

Original solution is found on codeigniter forums http://codeigniter.com/forums/viewthread/82091/

Subversion svn auto deploy project on commit

Filed Under (linux) by admin on 14-04-2011

Automate the deploy of your project on svn commit, this require you have access to your svn server

On your server got to your repo folder
/usr/local/svn/my_repo
———————————————————————–
then go to hooks folder
/usr/local/svn/my_repo/hooks
———————————————————————–
then copy the post-commit.tpl to post-commit
cp post-commit.tpl post-commit

the post-commit file is a file called by subversion after every commit, basically its a bash script
———————————————————————–
chmod the post-commit file
chmod +x post-commit
———————————————————————–
Now lets edit the post-commit file.
Lets say your project dev directory resides on the same server, the post-commit file has content so we erase them all and add this


#!bin/usr/bash
cd /home/dev_website
svn up .

what the bash does is change directory to the /home/dev_website then execute the svn update command
———————————————————————————————————————————————–

and were done, next time there is no need to log in to the server just to svn update of your dev website.

hypenate function

Filed Under (codeigniter, php) by admin on 16-01-2011

The hypenated function helps you make a hypenated string.

It replaces the spaces with a hypen (-), good for SEO and clean url string.
Example: “Room nr IT Park and Country Mall”
Becomes: “Room-nr-IT-Park-and-Country Mall”

function hypenate($url){
        $patterns[0]= "/,/";
        $replacements[0]="";
        $patterns[1]="/\s\s+/";
        $replacements[1]="-";
        $url = preg_replace($patterns,$replacements,$url);
        return $url;
}

Usage in PHP

hypenate("The quick brown fox");

output: The-quick-brown-fox

It can also remove out specific string you don’t want to show up on your url e.g. a comma “,” just specify it on the patterns[0] array in regular expression form

 $patterns[0]= "/,/";

Get the clients IP Address in PHP

Filed Under (php) by admin on 03-11-2010

Tagged Under :

This function will get the client’s IP adress

function getClientIP(){

    if (!$_SERVER['HTTP_CLIENT_IP'])
         $ip = $_SERVER['REMOTE_ADDR']
    else
        $ip =$_SERVER['HTTP_CLIENT_IP'];
    return $ip;

}
ads
ads

Jobs at Lexmark Cebu

Software Tools Developer 5 Dec 2008, 1:11 pm

Software Tools Developer

Source: Jobs at Lexmark Jobs at Lexmark |

Company Nurse 5 Dec 2008, 1:11 pm

Company Nurse

Source: Jobs at Lexmark Jobs at Lexmark |

Industrial Designer 5 Dec 2008, 1:11 pm

Industrial Designer

Source: Jobs at Lexmark Jobs at Lexmark |

Data Owner 5 Dec 2008, 1:11 pm

Data Owner

Source: Jobs at Lexmark Jobs at Lexmark |

Firmware Product Systems Engineer (FPSE) 5 Dec 2008, 1:11 pm

Firmware Product Systems Engineer (FPSE)

Source: Jobs at Lexmark Jobs at Lexmark |

Talent Management Specialist 5 Dec 2008, 1:11 pm

Talent Management Specialist

Source: Jobs at Lexmark Jobs at Lexmark |

Business Control Analyst (Auditor) 5 Dec 2008, 1:11 pm

Business Control Analyst (Auditor)

Source: Jobs at Lexmark Jobs at Lexmark |

SAP System Analyst 5 Dec 2008, 1:11 pm

SAP System Analyst

Source: Jobs at Lexmark Jobs at Lexmark |

Firmware Development Engineers 5 Dec 2008, 1:11 pm

Firmware Development Engineers

Source: Jobs at Lexmark Jobs at Lexmark |

HR Officer (Shared Services) 5 Dec 2008, 1:11 pm

HR Officer (Shared Services)

Source: Jobs at Lexmark Jobs at Lexmark |

Technical Writers 5 Dec 2008, 1:11 pm

Technical Writers

Source: Jobs at Lexmark Jobs at Lexmark |

Spanish-speaking Customer Service Representative 5 Dec 2008, 1:11 pm

Spanish-speaking Customer Service Representative

Source: Jobs at Lexmark Jobs at Lexmark |

Technical Illustrator 5 Dec 2008, 1:11 pm

Technical Illustrator

Source: Jobs at Lexmark Jobs at Lexmark |

Recruitment Assistant 5 Dec 2008, 1:11 pm

Recruitment Assistant

Source: Jobs at Lexmark Jobs at Lexmark |

Team Lead 5 Dec 2008, 1:11 pm

Team Lead

Source: Jobs at Lexmark Jobs at Lexmark |

Technical Support Representative 5 Dec 2008, 1:11 pm

Technical Support Representative

Source: Jobs at Lexmark Jobs at Lexmark |

Technical Trainer 5 Dec 2008, 1:11 pm

Technical Trainer

Source: Jobs at Lexmark Jobs at Lexmark |

Software Build and Library Administrator 5 Dec 2008, 1:11 pm

Software Build and Library Administrator

Source: Jobs at Lexmark Jobs at Lexmark |

Business Database Administrator 5 Dec 2008, 1:11 pm

Business Database Administrator

Source: Jobs at Lexmark Jobs at Lexmark |

EDI - Support Analyst 5 Dec 2008, 1:11 pm

EDI - Support Analyst

Source: Jobs at Lexmark Jobs at Lexmark |