Skip to main content

Posts

Showing posts from 2012

View all drives in mac lion

Do you also feel the need to see all the files and folders that your mac has it is very easy and simple to do   Press ALT + TAB and select finder you should see this at the top selection menu  Then Click on Finder and then on Preferences You will see a menu like this  Now all you need to do is just check all the Hard Disk and External Drive boxes and you are done. Let me know if you have any more issues I'll be more than happy to help.

Refresh a page using jQuery

The easiest way to refresh a page is: to use "location.reload();" Example: $( document ).ready( function () { $( '#template_add' ).click( function (){ var textarea = $( '#textarea' ).val(); var tag = $( '#template_tag' ).val(); $.ajax({   url: '/templates/addtemplate' ,   type: "POST" ,   data: {text: textarea,temp_tag: tag},   success: function ( data ) {   location.reload();   } }); }); }); It is very easy process, let me know if you have any issues.

command to view stash in git

Hello,    today I learned about how to view the stash that you have on ur local system using terminal, I use github to store my repo and work on it, the command to do it is git stash show -p stash@{0} where you can replace 0 with the stack number. Happy forking! :)

get rid of remove You have new mail in /var/mail/username on a Mac

open a terminal and use mail at the prompt, then d to delete one message or d1-4 for for four messages. Then q to quit Hope it helped, I also want to give the credit of this answer to  dmckee ,  whitequark  for sharing the correct answer in  http://superuser.com/questions/149282/safely-get-rid-of-you-have-new-mail-in-var-mail-on-a-mac

Adding Regex validations in Zend Framework

Hello Friends,       The code to add a validation in zend framework is: given below is the regex for alphanumeric chater! $alpha = new Zend_Validate_Regex( '/^[a-zA-Z0-9]+[0-9]+[a-zA-Z0-9]*$/i' ); $alpha->setMessage( 'Password must be alphanumeric' ); $userPassword->addValidator($alpha); if the regex is not correct nothing will get displayed!

T_ENCAPSED_AND_WHITESPACE

PHP Parse error:  syntax error, unexpected T_ENCAPSED_AND_WHITESPACE! Tired of this error, the solution is: the value which you are trying to get from $_POST or from web browser to server are getting in using single quotes and you are trying to access them using double quotes or vice versa! example On Jquery client side: $('#submit_transaction').live('click',function(){ $.ajax({ url: '../abcd/addTransactionview.php', type: "POST", data:{ created : $('date').val(), amount : $('amount').val(), merchant : $('merchant').val(), authToken : $.cookie("authToken") }, success: function(data) { $('#preview').html(''); $('#preview').html(data); } }); }); On Server side: $authToken = $_POST("authToken"); $created = $_POST('created'); $amount = $_POST('amount'); $merchant = $_POST('merchant');

Difference between is_file and file_exists

If you want to know that the argument supplied is a file or not use is_file() file_exists() will take both file and directory as input and return true if they exists. So, unless you specifically want to check if the argument passed is a file use is_file otherwise use file_exists()

All your Imagick Install Problem!!

Hello, So you are having problem installing ImageMagick! Find the errors below and the solution to resolve it, right next to it. First of all if you are installing the software after December 2011(offcourse ur!!), always always install it from the source stop using the stupid useless(just 4r this case) yum command. I'll show you how to install the software from the source: sudo yum groupinstall "Development Tools" ( the above command will install the following tools MAKE SURE TO USE IT WITH CAUTION bison,byacc,cscope,ctags,cvs,diffstat,doxygen,flex,gcc,gcc-c++,gcc-gfortran,gettext,git,indent,intltool,libtool,patch,patchutils,rcs,redhat-rpm-config,rpm-build,subversion,swig,systemtap) sudo yum install rpmdevtool libtool-ltdl-devel yum install freetype-devel ghostscript-devel libwmf-devel jasper-devel lcms-devel bzip2-devel librsvg2 librsvg2-devel liblpr-1 liblqr-1-devel libtool-ltdl-devel autotrace-devel yum -y install gcc automake autoconf lib