phpmailer gmail phpmailer package might not work for gmail, that’s could be fixed by enable “Allowing less secure apps to access your account” Enable php error display sudo cp /private/etc/php.ini.default /private/etc/php.ini This always works for me: ini_set(‘display_errors’, 1); ini_set(‘display_startup_errors’, 1); error_reporting(E_ALL); However, this doesn’t make PHP to show parse errors – the only way to […]

Command lines

To delete tons of files under a dictionary find . -name “*.png” -print | xargs rm Enable vi syntax highlighting by default vi ~/.vimrc syntax on Enable psql command on Mac OS X terminal 1. Run locate psql | grep /bin in terminal. (e.g. /Library/PostgreSQL/9.4/bin/psql) 2. vi ~/.bash_profile 3. insert export PATH=/Library/PostgreSQL/9.4/bin/:$PATH Enable NTFS r/w […]


Delay function in C++ For test purpose, there may require some pause during the code processing. #include <iostream> #include <unistd.h> using namespace std; int main(int argc, const char * argv[]){ int second=5; cout << “Hello, World!\n”;     sleep(second); cout << “I’m back\n”; return 0; }