Posts

Showing posts from 2017

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.js Open zh_HK.js, change zh-hk to zh_HK Rename zh_cn.js to zh_CN.js Open 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

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 page Manually 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 t

[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.ini Open /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 someon

[SEO] How do I create a "Q&A" type content and get rank in Page 1 in 15 mins

I am currently working on a project about marriage, and often get stuck when you don't know what content to create, the "Q&A" type content may be useful to you. Here is how I get a blog post rank on page 1 (#3 - #4) in 15 mins Find out what is the most frequently asked question that: People are asking on a particular topic There is no exact questions in search result "Title" Create a blog post with that question.  Use the exact question in your title.  For example, if you observe that there are a lot of people ask: "How do I grow higher", your blog post title must include: "how do I grow higher" You will expect that the search volumn is low, or at least not as high as other common search term It is normal, as you are going to capture the traffic that ask the exact same question Once you create the blog post that answer the question, you can always add a Call-to-Action button or link to the page you want people to go (or an

Do not buy Hostgator Wordpress Cloud Hosting. I am serious.

This is Hostgator Wordpress Cloud Hosting:  https://www.hostgator.com/managed-wordpress-hosting I use this service for my 2 websites, but it disappoint me a lot, I highly recommended NOT using it. My usage: WP site with Avada and woocommerce, less than 10 plugins, NO WPML. Here are why: The allowed memory setting is 256MB at MAX.  The memory level you can use is very low.  The site easily got memory exhausted. Image upload will fail if you upload too many images at once.  When I say too many I mean 4 - 5 images.  The reason: Memory exhausted.  Those images are within 100KB, with dimension within 1000px x 1000px.  Definitely NOT big, HD kind of images. The performance is not good: although the page said the speed is 2.5X faster, well according to my experience, it is not.  And my partner who also feel no performance gain of using this cloud hosting. The time wait to get live chat for support is very long Please do not expect that you have the same CPanel as other normal pla

Drupal 7 Multisites Migration: Different Domains to Same IP address No host file

Image
Background: The site is running Drupal 7.  User wants to have a UAT sites for that, but they don't want to change their host file because it is troublesome. So I make some key-points on how to do it and I want to share it here. Let's begin. .htaccess file: Make sure you .htaccess file DID NOT have any rewrite rules that redirect user to particular sites.  In my case my .htaccess file have these line: I need to comment it out in order to make things work.  Pay attention to that. settings.php As you can see, under htdocs folder, I have 1 sub-directory for this Drupal 7 site.  And within this Drupal 7 site, I have 3 sites.  So when a user goes to: subdomain1.domain.com subdomain2.domain.com subdomain3.domain.com They will be redirected to different folders. * I did not set $base_url in settings.php (this is commented) * Make sure in your settings.php $databases var, set the 'prefix' value in your array.   Reference here . * Yes I DID NOT se

My Inspiration on writing emails sequence that match the market

I am currently writing a 18 days email sequences that sell an affiliate product in a relationship niche. The target market is mainly women. Originally, I quote some YouTube video as my content for the email, and those video are mainly from Tony Robbins. Nothing wrong with that, he is a good relationship coach, almost everybody in U.S. know him. But if you think there is nothing wrong with that, you are WRONG! When you are using celebrity, I think one of the way to approach this is to use a celebrity that your market admire and follow. Tony Robbins is great, but since most of my market are women, I choose Oprah Winfrey instead of Tony Robbins. For a women, I think Oprah will have a more "close" relationship then Tony. Look at their audience: Tony's event will have 1/2 men 1/2 women. And then look at Oprah show: 90% (or even more) women! Oprah talks to women, and my market is for women. Oprah is therefore much more appropriate then Tony. Hope it helps someone.

[Solution] MySQL Command line import - MySQL has gone away

To people who have problem importing a large (over 5XX MB) SQL text file: If you are having problem of importing a large SQL file with over 5XX MB, you will get an error: MySQL has gone away. Even if you are using command line import. While raising max_allowed_packet to a very high value (> 800 MB) still not help.  You can do this: Login to mysql command line tool using: mysql -u<username> -p, and then enter password Raise max_allowed_packet INSIDE the mysql console ( Reference here ) by typing: "set global max_allowed_packet=1*1024*1024*1024".  The value is in bytes.  So I type the equation here, which is equal to 1G.  Yes I know this is crazy... When you see "mysql>", you type "source <SQL_file_name>".  I put the SQL file together with the mysql.exe (I am using windows) so the above command works for me.  You may need to adjust your path in order to make it work.  By running this command the SQL file will be parsed and run