Which tool can I use to generate a .jshintrc file with default options? - jshint

I've being using JSLint for some time now and recently found JSHint. Reading the docs I learned that it can be configured using a .jshintrc file but I could not found if it's possible to generate this file using the CLI.
Is there a flag in the CLI to generate such file (preferably with all the options set) or another tool that allows me to do that?

Not really going to answer your question but I found the JShint I use on some article about code style guides, in a free HTML eBook SpeakingJS - Style guide.
They talk about Google's guideline, AirBNB's guideline, jQuery's guideline, and others, most of the time those links provide its a ready to use jshint file ... may be this could help you :).
If you want to generate your own JSHint, I don't know if you are familiar with Yeoman but this project is exactly what you re looking for : https://github.com/losingkeys/generator-jshint
After generating it, any text editor can be used to edit such a simple file.

Related

grunt for SAPUI5

I am configuring grunt for SAPUI5 project. I can configure grunt taks for minify, test and etc. I see there is grunt-ui5 grunt plugin but I am not able to understand what exactly this plugin is doing or useful to SAPUI5 projects.
Thanks
The grunt-openui5 plugin by SAP is documented at github.
It can be used to build UI5 themes and package components and libraries into preload-files.
UI5 tries to load most of the modules of a component or library with a single request from a component-preload.json / library-preload.json file. If it cannot find a preload file, it has to request all modules individually resulting in many many requests and thus poor performance.
grunt-openui5 is used to create these preload files. It also minifies the code while doing so.
The grunt-ui5 plugin is something inofficial which seems to do similar things. You would have to ask the author directly to get more information. I recommend to use the official grunt-openui5 plugin.
For ui5 applications it's not common to use the grunt task for minification , instead we use the grunt-openui5 task. It will create the preload file, which is a json object that contains the whole app.
{
"version":"0.0",
"name":"app name",
"modules":[
"control1": "code for control1",
"control2": "code for control1",
]}
When control1 is required, ui5 just uses the preload to get the code for control1. In this way, ui5 avoids triggering a new request. Anyway, If the preload file is not present, it will have to request control1.js .
If you want to see a real preload file, open any ui5 app and go to the network tab of the browser.
Using the grunt-openui5 plugin for grunt, it will do the work for you, and will give you as a result a library.css, rtl, library-parameters.json (same thing, but for themes) and the preload.json (for the js files).
Instead of using grunt-ui5, I would recommend you to use the the oficial plugin grunt-openui5!
grunt-openui5 is a really amazing grunt plugin created by bunch of SAPUI5 core dev team ;)
It mainly allow you to do 4 things:
create Component-preload.js (optimized and minified version of your app)
create library-preload.js (optimized and minified version of a custom library)
create a custom theme
create a local web server to test your app locally
I've covered it a little bit on my blog post Custom Control 101 if you want to check it out.
I'm using it in daily basis and you can read some of my blog posts about it.
Just a small remark: in the future, consider switching from grunt to gulp, as gulp is newer and faster. For SAPUI5 there are packages with same functionality in gulp, as ingrunt.

single secure executable for tidesdk

I just started looking into TideSdk and noticed that when I "compile" (or package) a project (in Win-7), I get all of these dependecies which is actually the un-compiled source code for the app.
Is there any way to:
Have Tide SDK package a file to one executable
Not have the source code visible in any way, shape, or form in the final executable?
If none of those are possible, is there an alternative that can to these things?
We are working on a solution. There are a few possibilities. The only thing that is possible currently is to obfuscate your code using google closure library through a tidebuilder option.
I found this on google when trying to do something similar. It is annoying but seems to work.
http://coffeecone.com/post/36127491095/howto-single-exe-for-tidesdk
I use the application virtualization app Cameyo for this purpose. http://www.cameyo.com/

How to validate HTML/CSS files with grunt.js?

This is a noob question.
I would like to use grunt.js as a build tool for my web project. Can use grunt.js to validate my HTML/CSS files? Do you have an example of such a grunt.js file?
There is another plugin that seems to be updated more often and does not require java. grunt-html-validation. It has a number of options and has been working great for me. You can install and use it like this:
npm install grunt-html-validation --save-dev
Then put something like this in the initconfig of your Gruntfile.js
and this in appropriate places in your Gruntfile.js
grunt.loadNpmTasks('grunt-html-validation');
grunt.registerTask("default", ["validation"]);
There is also a number of useful options including the ability to relax errors based on a regular expression (could be useful for AngularJS for example) and the ability to save a report.
You can use the grunt plugin grunt-html. Beware, you will need Java on your computer to use it. It works well for me.
As of now there seem to be two popular HTML validation plugins:
grunt-html-validation
grunt-html
grunt-html-validation uses the W3C Markup Validation Service and grunt-html uses a local copy of the java-based The Nu HTML Checker.
They both work well and have very similar options so it comes down to whether you want to wait for an external service call or wait for a local java app.

Documentation of Qt in CHM format

Is it possible to find some information about Qt? I need chm file with all documentation of all classes (https://doc.qt.io/qt-5/classes.html). Does somebody knows where can I find it?
If you have installed Qt in your machine, use Qt Assistant. The help available are pretty much the same as that in the online.
Qt Assistant is just an application which requires no internet connection and useful for offline help..
You can use the script from this site: http://www.interclasse.com/scripts/chm.php in order to generate chm file from an online tutorial you find anywhere in the web. Like this one: http://doc.qt.nokia.com/nokia-qtsdk-1.0/index.html
I haven't tried it myself, but seems rather promising.
Good luck!
I've made a little script that will automatically build a CHM file out of the latest available documentation for QT. All credits to char101 for the main script that actually converts HTML docs into the CHM project, my part was only a little automation.
https://github.com/vzhd1701/qt-documentation-chm-autoupdated

Liferay: how to avoid rebuilding/redeploying CSS files

if you're familiar with Liferay you'll know that when you make an itsy-bitsy change to a css file you shall rebuild the theme and redeploy it.
As for redeploying I made a symlink (mind you I'm on Windows: for the curious creating a symlink on Vista is just a matter of issuing mklink /d dir1 dir2).
But what about rebuilding the stuff with maven? I'd rather skip that step. Basically what it does is combyining and packing all CSS in one everything_packed.css. Is there a sort of config variable to tell liferay just to include the raw files and skip redeployment alltogether?
Thanks
Guys I found the solution myself.
You should have a file called portal-ext.properties file in
$TOMCAT_DIR/webapps/ROOT/WEB-INFO/classes
Or more specifically for my win setup in
C:\liferay\webapps\ROOT\WEB-INF\classes
The file would hold the value
theme.css.fast.load=false
This will prevent liferay to be looking for the everything_packed.css and so you're free to modify your stuff without rebuilding and CTRL-R to refresh the page and see the changes.
Just for completeness, as this question is somewhat old and the problem already solved: There's a lot more along these lines, e.g. javascript, layouts etc. that can be used uncached. This is documented in either the Liferay Wiki (as Developler Mode) or the Development Guide, available from the documentation site (though currently it's not there for the last version - if it's still not there when you're reading it, look for it (PDF) in the older versions.
It's advisable to use these settings only in development, not in production, as putting all css and javascript in as few files as possible results in a huge performance impact.
to include all those settings, just can also just add the following line into your portal-ext.properties file:
include-and-override=portal-developer.properties
this will include all the developer specific settings, and when you want to remove them, you can just comment out this line.
you can edit the css files of your theme from Webapps{your theme}\css
And can see the changes directly.
You can edit almost every file which doesn't require compilation.like .jsp files but not .java files

Resources