Posts

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...

[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 so...

[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 h...

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...

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 ...

Common Apache PHP .htaccess Security Header Updates as of 2016-11-08

These are common .htaccess security header that should be applied to almost all websites. This is useful for Apache/PHP combination. Add the following in your .htaccess file: <IfModule mod_headers.c>   Header always set Strict-Transport-Security "max-age=3600; includeSubdomains;"   Header set X-Frame-Options SAMEORIGIN   Header set X-XSS-Protection "1; mode=block"   Header set X-Content-Type-Options "nosniff"         # You can modify the following to allow external (e.g. CDN) javascript   Header set X-Content-Security-Policy "allow 'self';"         # You can replace "PHP" with "-" to completely hide your PHP version   Header set X-Powered-By "PHP" </IfModule> Hope it helps someone.

Jay Abraham The Ultimate Entrepreneur Show 69 Drew Kaplan Part 1 - My take

17:00 - Think lateral: The formula: Think 10 random words (music, phone, font, key etc...) Use the name of your product Write a sentence that combine 1 word an your product name e.g. My product: How to make money ebook My words list with product name combined: Music - Make money like playing world-class music Phone - Make money just like taking a phone call Key - Secret key to success in make money online Flying - Make money as free as flying in the sky Look at side way - coming up with 6 - 8 ideas

雁王

http://baike.baidu.com/item/%E9%9B%81%E7%8E%8B/16481043 世界上有四種人,死人、失敗的人、愚蠢的人,以及……我。 -- (赤羽信之介:你們的目的?) 說了,游戲就失去趣味了。 (赤羽信之介:不考慮現出底牌,在此將我格殺?) 我不想傷及無辜。 -- 最好的決定,往往也是意料中的決定。 萬無一失,往往是萬一有失。 失之東隅,收之桑榆。有失敗的開始,才有成功的一步。 -- 一個人越想得到的時候,就會越怕失去。可悲的是,想得到的越急切,失去的可能就越大。這是人性的弱點。 -- 我喜歡失敗的第一步,因為失敗,總是成功的墊腳石。 -- 有一個人,他住的地方,有一個深坑,有一日,他想了解這個坑,到底有多深。他放索而探,而索短絀;他投了石,一去無聲。他很好奇,他太好奇了。你認為,該怎樣,才能滿足他的好奇? (凰後:就縱身跳入深坑,用親身了解,這個坑,到底有多深。) 你落地了嗎? -- 光明總自以為速度最快。但事實呢?黑暗始終在前方,靜候著光明。 輸,算得上什麼?只怕世上,沒人讓我贏。 -- 世上所有的衝突,皆源自於執著。 至今,無人可以完全放下。 -- 別再侮辱智謀這兩個字了,如果你拙劣的手法,也能稱得上是算計,那愚蠢兩字在世上,就沒被使用的機會了。 靜!我正在思索,要如何用你聽得懂的言詞,向你解釋局勢。 -- 噓,注意聽—— -- 自以為投奔光明,卻墜入更大的黑暗。這是你們墨家十傑的通病,藥石罔效。 太膚淺了,為了讓自己的目標,有一個世俗的依據,甚至求得世俗的認同,所以想方設法將所有的行為,用意義包裝。這層虛偽,是世上最脆弱的糖衣。你問我意義,那我,也只能用這個虛偽的形式,給你一個答案——消滅意義,就是我的意義。 唯有黑暗,能吞噬黑暗。毀掉墨家的,是墨家本身。 善射者死於矢,善戰者死於兵,善泳者……溺於水。 -- 一個人若要攀上高峰,就要吃苦,就要流汗。雖然艱難,但當他佇立在高峰之上,他會發現,這一切,都是值得。 (神蠱溫皇:反之,一個人若要向下沉淪,就相對容易多了。人啊,無論從哪裡往下跳都很容易,因為墮落時的快感,通常都會伴隨著罪惡的愉悅。) 如同過往的溫皇一般嗎?直到落地之後,才開始後悔。因為發現斷崖下,是一處陷人的泥沼,是一個無可復的深淵,甚至...

How to fix "Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress"

Image
TL;DR - Check your cookie content in developer tool (Chrome) or Firebug (FF), see if your "cookie" is "httponly". - If yes, somewhere in your Apache config set this: Header set Set-Cookie HttpOnly;Secure Comment this (Don't run this line) and restart your server. Why it occurs? I encountered the line below when I login to WP 4.5.3: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress The problem:  your setcookie() statement in wp-login.php cannot produce a cookie WP needs, even if the function returns "true".  As below (Click to enlarge): If your developer tool shows that, it means that your web server is securely don't allow cookie to be transferred with the web protocal, result in PHP not able to create the cookie WP wants. Now if it is your situation, you just need to disable this function in your web server, and it should be fine (at least it works for me). Or you can chang...

How to fix fancy box/Easy Fancybox scroll not work in mobile

Hi The Problem: If you are working on EasyFancybox or just normal fancybox JS , and you have this problem: In your iOS device when a popup is opened, if the page is too wide and your pop up cannot show all, when user taps and drag the screen, the background will be dragged instead of the pop-up content. To fix, add this in your CSS: -webkit-overflow-scrolling: touch !important; So which element should you apply it to? In Easy Fancybox, you will see these 2 lines: <div id="fancybox-content"........>         <iframe id="fancybox-frame" name............... Apply to fancybox-content, not fancybox-frame So in your CSS, it should be: #fancybox-content{         overflow: scroll !important;         -webkit-overflow-scrolling: touch !important; } It works for me, and I hope it helps someone also.

Mike Koenigs/Jordan Belfort Interview 16 Jun 2016

Notes: 5 steps to create your own book: Preparation: Interviewing other expert or become an expert.   Is there a market that you want to write? Does the audience has money? Did people passionate about the topic? Come up 10 key questions to ask yourself or other experts Perform: Title, Subtitle, what is it about, what is the content gonna be Ask what is the most frequent questions you are getting asked about ____? Answer that question, record your response = chapter 10 questions > 10 chapters publish promote profit

[Solved] jQuery: JSONP and JSON: Uncaught SyntaxError: Unexpected token :

This link is, by far, the clearest explanation on JSONP and JSON. http://stackoverflow.com/questions/7936610/json-uncaught-syntaxerror-unexpected-token Hope it helps someone.

[Updated]How to save/download streaming asf/wmv file using VLC 2.2.1

Image
If you have some old wmv/asf windows media player file, here is how: I am using Windows 7 and VLC 2.2.1 1. Select "Open Network Stream 2. Paste the URL in "1", and in the drop down on the bottom, select "Stream". 3. You will see the screen below, by default you will see the source file you just paste, click "Next". 4. In the drop down list, select "File" (the first item), and then click "Add" 5. Enter the destination file path (including the file name) in "Filename" 6. Accept default setting, unless you want to convert it to another format.  If that is the case, select another profile from the drop down list. 7. Click "Stream all elementary streams", then click "Stream" 8. The streaming will then start, the player time line will be used as "Process".  Once it is done, you will see your file (in this case MP4) in the file path you specified. 9....

[Solved] EventBuilder Theme google map api missing m1.png, m2.png error

If you are using ThemesDojo theme "Event Builder" and encounter the following error: http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m1.png - 404 Not found. Here is the reason and solution , and below is my implementation to the theme "EventBuilder": Upload the missing image files First, download the cluster.zip from the link above.  Unzip and upload it to your theme. In my case, I uploaded it to /wp-content/themes/EventBuilder/images/cluster/m1.png (and so on). Modify the javascript - Open /wp-content/themes/EventBuilder/partials/part-sliders.php - Find this line: var markerCluster = new MarkerClusterer(map, markers, { maxZoom: 9 }); Replace it to the following: var mcClusterIconFolder = "/wp-content/themes/EventBuilder/images/cluster"; var mcOptions = { maxZoom: 9, styles: [ { height: 53, url: mcClusterIconFolder + "/m1.png", width: 53 }, { ...

蕃茄,薯仔,紅蘿蔔,魚湯做法

先稍稍煎魚(毋須煎熟),再落水煲 煲魚湯至白色,撈起魚(隔骨) 切紅蘿蔔,薯仔,蕃茄落煲 慢火將材料煲至冧(應該很快) 煲好落鹽,先試味再調整 紫菜,大豆芽,瘦肉,落鹽調味 豬肉用來煲湯就要出水

蕃茄米粉做法

2 人份量 蕃茄 5個  (平均 1 人 2-3 個)不要頂,去核,開 4 邊,蕃茄切粒 開鑊炒蕃茄至冧 把蕃茄倒入煲再加一湯碗半水,加半飯碗蝦米再以中火煲 其間處理豬肉碎 :2 匙豉油,少少油, 1 羹鷹栗粉/豆粉, 1/3 匙鹽, 2 匙糖拌勻 此時蕃茄見開始冧就落生豬肉然後滾至豬肉熟 落半湯羹魚露 落小半羹雞粉 一匙蝦醬 再中慢火煲一會(滾一滾)即可 蕃茄份量視你對濃淡需求為何