How to search and replace globally, starting from the cursor position and wrapping around the end of file, in a single command invocation in Vim?

You are already using a range, %, which is short hand for 1,$ meaning the entire file. To go from the current line to the end you use .,$. The period means current line and $ means the last line. So the command would be: :.,$s/\vBEFORE/AFTER/gc But the . or current line can be assumed … Read more

How to put a delay on AngularJS instant search?

UPDATE Now it’s easier than ever (Angular 1.3), just add a debounce option on the model. <input type=”text” ng-model=”searchStr” ng-model-options=”{debounce: 1000}”> Updated plunker: http://plnkr.co/edit/4V13gK Documentation on ngModelOptions: https://docs.angularjs.org/api/ng/directive/ngModelOptions Old method: Here’s another method with no dependencies beyond angular itself. You need set a timeout and compare your current string with the past version, if both … Read more

Beginner’s guide to ElasticSearch [closed]

Edit (April 2015): As many have noticed, my old blog is now defunct. Most of my articles were transferred over to the Elastic blog, and can be found by filtering on my name: https://www.elastic.co/blog/author/zachary-tong To be perfectly honest, the best source of beginner knowledge is now Elasticsearch – The Definitive Guide written by myself and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)