Posts

[Solved] CodeIgniter/CI 3 - 404 Page not found (with or without subdirectory) problem

Check the following if you have 404 Page Not Found error when you deploy your CI application to Linux, while there is no problem under MS Windows.


Check if your controller file name and class name inside that file have identical (not ONLY the same, but Identical) name.  For example, if your controller class name is MyController, your controller file name must be: MyController.php.  mycontroller.php does not work, Mycontroller.php does not work.  It MUST BE MyController.php, identical to class name MyController.
Hope it helps.

[Solved]LiveAgent (LADesk) Rules HTTP Request What is inside HTTP Body?

Image
In short, if you don't know what should be put inside the HTTP Body field when you are using HTTP request as rules, here is the string that contains "Everything".

Just copy and paste the below code to your HTTP Body box and you will get everything sent from LA to your URL.



---- Start Here -------
initiator_id={$initiator_id}&initiator_username={$initiator_username}&initiator_firstname={$initiator_firstname}&initiator_lastname={$initiator_lastname}&last_in_ticket_agent_id={$last_in_ticket_agent_id}&last_in_ticket_agent_username={$last_in_ticket_agent_username}&last_in_ticket_agent_firstname={$last_in_ticket_agent_firstname}&last_in_ticket_agent_lastname={$last_in_ticket_agent_lastname}&conv_last_message={$conv_last_message}&conv_code={$conv_code}&conv_conversationid={$conv_conversationid}&conv_datecreated={$conv_datecreated}&conv_datechanged={$conv_datechanged}&conv_datedue={$conv_datedue}&conv_priority={$conv_prior…

Microsoft BotFramework - Why my image not show on FB?

One of the reason is because MS BotFramework is assuming you to use HTTPS for everything (link especially).
So if your message outgoing link is not HTTPS, you may not be able to show the image in your FB messenger.
Hope it helps someone.

Parsley.js - zh_HK/zh_CN is not available in the catalog

If you encounter:

zh_HK is not available in the catalog

or

zh_CN is not available in the catalog

error when you use caldera form under wordpress, or using it in standalone application, the problem is that parsley.js will load zh_HK.js (or zh_CN.js) in the web page.  However, in the i18n directory, there is no zh_HK.js.

Even worst, for TW and CN language, the file name is zh_tw.js and zh_cn.js.

And even more worst, inside zh_cn.js the name 'zh-cn' is used.

So to solve this problem, here are what I have done:

Duplicate a new file using "Save As..." from zh_tw.js to zh_HK.jsOpen zh_HK.js, change zh-hk to zh_HKRename zh_cn.js to zh_CN.jsOpen zh_CN.js, change zh-cn to zh_CN There will be no more javascript error.
Hope it helps.
Thank you.

Coaching: What you need to know

TED talk:

My take on the video about "Everyone needs a coach":

1/3 of top performers has a coach, and 2/3 are open to be coached.The best performers all have coach, why don't you?Lifelong learning, even on your own, is kind of "coaching", you are coached by the books you read, the video you watch, and the blog post you are reading (like this one!)Not only in your business, but it is also OK to have a coach for your life, or called "life coach"Even if all that, people are too scare to ask for help.People, especially top performers/CEOs, don't ask for coaching because "They are supposed not to".  It is a Face-value problem and may be seen as "Not up to the job". :)If you need a coach, look for one.  Or don't limit to a human coach, read books, get all the materials you need, coach yourself.Don't stay here and waiting for help, go ask for it if you need.Everybody needs help, and asking for it is not a shame, not at all.KEY…

Android/iOS webview jQuery.animate({scrollTop: y}) position problem - Solved

Problem: This is not obvious in iOS but very obvious in Android.

Assume that you have a checkbox on the top of the page.  And the page is so long that you need to scroll to the bottom to see it all.  Moreover, there are so many long text that a line will be wrapped to another new line.  (Like a Terms and Conditions page)Now, assume that you have a button at the bottom of your page that will use jQuery.animate({scrollTop: <some_number>}) to scroll to that checkbox.  <some_number> is the offset().top position of that checkbox element.Now open your Android webview in app, load that pageManually scroll to the bottom of the page, and then tap the button to scroll to the checkbox element at the top.You will not be able to see the checkbox element.  Because the scrollTo position is incorrect. Let me say that again: this would not happen (at the time of this writing) in iOS webview. Solution: My colleague found that the reason is simply because: your line is too long.
When a line …

[Vagrant] 413 request entity too large for nginx/1.8

If you are using Vagrant and rasmus vagrant box, you may find that you cannot upload a large file (like 200MB) to your local server, result in error:

413 request entity too large  / nginx/1.8
And if you add client_max_body_size 200M; in your /etc/nginx/conf.d/xxxx.conf server context, it does not work.

Increase the value of max_post_size and upload_max_filesize in your php.ini (/etc/php71/php.ini or /etc/php56/php.ini)

post_max_size=200M
upload_max_filesize=200M

did not work.
What works?
Stop the php-fpm service (sudo systemctl stop php-fpm) and nginx service (sudo systemctl stop nginx)Yes you need to add post_max_size=200M and upload_max_filesize=200M, and also realpath_cache_size=200M in your php.iniOpen /etc/nginx/nginx.conf, inside http{}, add client_max_body_size 200M; (remember to add the semi-colon at the end).Start the php-fpm service (sudo systemctl start php-fpm) and nginx service (sudo systemctl start nginx) again.Done! Hope it helps someone.