vim YouCompleteMe not working on MacVim - javascript

I am a huge fan of vim and I've been using it for the last two years. I'm quite new to web programming. Currently I'm working on Node.js and I wanted some additional plugins which can help me learn this new technology. I installed tern_for_js and YouCompleteMe using Vundle. I also compiled YCM, but I don't see any auto-completion or javascript support. Here is my .vimrc:
syntax on
set number
set laststatus=2
set nocompatible
set expandtab
set shiftwidth=2
set smartindent
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'bling/vim-airline'
Plugin 'scrooloose/nerdtree'
Plugin 'ternjs/tern_for_vim'
Plugin 'Valloric/YouCompleteMe'
call vundle#end()
:map <F2> :echo 'Current time is ' . strftime('%c')<CR>
set guifont=ProggyCleanTT:h18
colorscheme torte
NERDTree
Can anybody tell me what I'm doing wrong. Or did I miss something? Is there some extra configuration that have to be made?

The following lines are crucial for vundle to work correctly
filetype off " required
put it before
set rtp+=~/.vim/bundle/Vundle.vim
Turn it back on after vundle end
call vundle#end()
filetype plugin indent on
Also you don't need :map , map is fine.

Related

How to hide the version of jQuery

I'd like to hide the version of jQuery library used in my project so nobody can see which version is in use (at least just by quick looking at the code).
While removing a JS comment containing jQuery version is fairly easy, there is a variable hardcoded into jQuery which reveals the version:
var ah = "1.11.3"
My wish is to empty the variable, however I'm not a frontened developer so I don't know what could potential consequencies.
Does jQuery uses this variable is some particular way?
So two points:
Yes removing that could have issues, 3rd party plugins will use: jQuery().jquery to get the version to see if the version used is a recent enough version for the plugin to work, if you remove that the plugin could not load or try and work and have massive issues if the version of jquery isn't 'good' enough.
Removing the version won't help in people not being able to identify if they really want to, it just adds a 2 minute step to the process of just comparing the rest of the code to jquery versions.
I would strongly advise not to remove the version number or change it.
I agree with others point but to answer your question . You can remove the version. you can just empty the version string.
var version = " "
If you give this in your source code even if you try to get the version using $.fn.jquery it gives the empty string.
To give more insight:
download the jquery from jquery.com
save it in the same folder where you create your file.
Include the script in your file in the script src tag.
go to the downloaded file and empty the version variable( var version = " ")
Now in your file even if you try to get the version number ,you cant.
Note : Try to not use the vulnerable version.

CKEditor Upgrade from 4.1 to 4.4.7

I'm having a couple of issues with my upgrade from 4.1 to 4.4.7:
Existing custom addons no longer work. I'm getting a JavaScript error
on the following call in my init function, for example:
CKEDITOR.plugins.add( 'pdf',
{
lang: 'de,en,es,fr,fr-ca',
init : function( editor )
{
editor.addCommand( 'pdf', new CKEDITOR.dialogCommand( 'pdf' ) );
.
.
.
It no longer appears to recognize addCommand as a valid method.
After removing all plugins, I am able to get the editor to appear, however, my menus have disappeared.
Is there a clear upgrade path from 4.1 to the current version, or at least a list of deprecated methods? I haven't been able to locate it.
Thanks.
You should probably at least scan the changelog. Breaking changes are always explained there.
Do remember you are trying to incorporate over 2 years of active development into your customized editor. There were lots of new features introduced during this time, so your plugins may need some serious adjustments.
As for particular methods, just check the API. Information such as whether something is deprecated or examples how it should be implemented will be there (example: editor.addCommand).
As for building custom plugins, check the plugin tutorials for some working code and explanations. The source codes are available on GitHub.
Last but not least, remember to clear the browser cache after changing any JavaScript/CSS files. This usually solves most issues with toolbar/menus etc. disappearing after an upgrade or configuration change.

Zend Framework Date Time Picker

I'm a real newbie in programming and finally got the ZendX Jquery to work. However, I would like to include a date time picker, and found an option at http://www.binpress.com/app/zfdatetimepicker/85 . However, the documentation is not complete and I would really want to set it up correctly. Can anyone help me with the steps required to do so? I tried setting it up and got the error " Object doesn't support property or method 'datetimepicker'". Thanks.
It sounds like you need to include the jquery UI script files. Looking at his demo, it is pulling in jQuery UI 1.8.21 from jquery's 'code' servers. I also know that without the UI component included, you will get the error message Object doesn't support property or method 'datepicker' when you do something like $('#myDate').datepicker. So I'm assuming you're just missing the correct script includes.
I've not used zend-framework at all, so I might be missing something on that side.

How to force update of design changes to clients using xPages?

I am bulding a webpage using xPages and I am making constant changes to script and design, this include both server and client javascript , stylesheet and image changes.
Each time I change a javascript or stylesheet I want to see my changes in the webbrowser and I also want my users to get the latest changes when they access the webpage.
I know I can use Shift-Reload, or CTRL-reload and clear my webbrowser cache. and I also know that I can change the objects expiration date, but I want a smoother and better controlled way to do this.
Looking for any kind of best practice for doing this.
Thanks
Thomas
In the xsp.properties file for the application or on the server for server wide use you can set xsp.application.forcefullrefresh=true. The xsp.properties file documentation says:
# Application refresh
# When this property is set to true, then a full application refresh is requested when
# the design of a class changes (means that all the data are discarded in scopes).
# xsp.application.forcefullrefresh=false
The new XSP Portable Command Guide says "This property was introduced in Notes/Domino 8.5.3. It is set to false by default and is particularly useful during the development phase of an XPages application."
I have not fully tested this behavior but it sounds promising. You could/should of course only set it to true WHILE you make the changes. once stable, set it back.
/Newbs
Adding to Ferry's answer and your comment;
Instead of "?dummy=randomvalue", you can use "?version=2.1". So it will be cached but when you change design, you can just increase the version.
There's a problem with this approach as some proxy servers won't cache anything with query params. Better to rename the file directly, adding date or version number to it. It will always work.
To disable caching temporarily use Fiddler2. It's easy to enable and disable in one place across any web client. As well as added benefits for the http request tracking features.
To fully disable any caching add url + '"?dummy=" + #Unique();' to every url to javascript or image files...
The way I am reading this question is that you want every change you make to appear immediately on the client's browser or client. Are you really sure you want to do this? It sounds like you are not doing any testing so any typos, bugs, crashes, etc will be passed on to your users. Sounds like a bad plan to me. I hope I am wrong and that you are using a template and pushing only your fully tested changes up to an production version instead of making the changes in the production version.
I would just put out a schedule of when changes are going to be pushed up to production and let the users reload their browser or client at that time. Either that or do it during off hours and when they next log on, they get the newest changes.
Adding to Ferry's answer and your comment;
Instead of "?dummy=randomvalue", you can use "?version=2.1". So it will be cached but when you change design, you can just increase the version.
maybe you could look at how domino can control caching of url's.
http://www.ibm.com/developerworks/lotus/library/ls-resp_head_rules/
NEwbs answer is a good one but it is useful to note that in Firefox there is a very useful plug in called "web developer" from Chris Pederick that allows you to disable the cache.
http://chrispederick.com/work/web-developer/
The other really useful one is Firebug which is just amazing - It makes any HTML work much easier
https://addons.mozilla.org/en-US/firefox/addon/firebug/
I did found another solution by putting my css and js in a theme it is easy to just rename the files.
as described here
http://goo.gl/vFTii
Why do not we use the window.location.reload()...
Which does the same like ctrl+F5
It reloads the page, which is similar to context.reloadpage

Add Subversion revision to included Javascript and CSS files

I'm looking adding Subversion's revision number to the name of each .js file we include, so whenever the .js file is updated, the browsers will automatically fetch the new version.
I believe Stackoverflow does this, but I wonder how. Is this part of the release procedure? Any hints on how to achieve this using Subversion tools?
There is no standard way to have Subversion add the revision to the file name. Use a build tool (for example, ant) and a custom target for this.
If you set the SVN Keyword "Revision" on the file which declares the tag, then the literal text $Revision$ becomes a SVN keyword. Each time you update the working copy, $Revision$ will update to read $Revision 1234 $ where 1234 is the current revision number.
Just be forewarned, we have run into problems with IE6 using this approach. We had put for all our tags (and applied the SVN Revision keyword to them) so that every time we push a new copy of code out to our production boxes, we know all clients will get the current revision. But IE6 sometimes creates weird errors when this happens; as though you were missing some of those script tags. In the end we took them out because it caused us more problems with IE6 than it ever solved us.

Categories