Which IntelliJ config files should I save in my dotfiles? - intellij-idea

I would like to keep my IntelliJ config files in my dotfiles repo but my ~/.IntelliJIdea2016.1 folder weights > 1.3G :(
~/.IntelliJIdea2016.1/config/ still weights > 215M...
~/.IntelliJIdea2016.1/config/plugins/ contains lots of binaries... not the best candidates for dotfiles :(
Anyone tried to save IntelliJ config without Export/Import settings menu option?

No need to store IntelliJ config file, just use
IDE Settings Sync plugin.
See this post: Better Synchronization of your Settings Across Devices

Sadly, it's not simple. The user configuration folders are not well-documented and have historically included a bunch of default junk, which is slowly being stripped out (see https://youtrack.jetbrains.com/issue/IDEA-128660 and https://youtrack.jetbrains.com/issue/IDEA-163616). The documentation of settings files is also very poor; my request for improvement was declined https://youtrack.jetbrains.com/issue/IDEA-154157).
I version control my settings. If you request access, you can see it at https://gitlab.com/jcrben-staples/dotfiles-group/dotfiles/tree/master/config/intellij-idea-latest with notes at https://gitlab.com/jcrben-staples/dotfiles-group/dotfiles/tree/master/config/intellij-idea-latest/MY_CONFIG_DOCS.md).
I set up my .gitignore to ignore everything by default, and then I whitelist the files that I want. With IntelliJ, I didn't know where to start, so I whitelisted the entire folder and then blacklisted a bunch of the files.
My blacklist doesn't exactly answer your question about what files to include, but it does give you an idea of what to exclude. I'll try to update this if I figure out which ones to include at some point, but it's a mishmash of plugin files and such.
Right now the blacklist looks something like this:
# IntelliJ IDEA stuff
.idea
!config/intellij-idea-latest/**
!projects/bi-idea/workspace.xml
# statistics files
config/intellij-idea-latest/options/statistics*
config/intellij-idea-latest/options/feature.usage.statistics.xml
config/intellij-idea-latest/options/usage.statistics.xml
config/intellij-idea-latest/options/statistics.application.usages.xml
# user files ??
config/intellij-idea-latest/user*
# other
config/intellij-idea-latest/options/atlassian-ide-plugin.app.xml
config/intellij-idea-latest/options/cachedDictionary.xml
config/intellij-idea-latest/options/customization.xml
# has my autobracket disable
config/intellij-idea-latest/options/CodeGlance.xml
# config/intellij-idea/options/editor.codeinsight.xml
config/intellij-idea-latest/options/databaseDrivers.xml
config/intellij-idea-latest/options/debugger.xml
config/intellij-idea-latest/options/dimensions.xml
config/intellij-idea-latest/options/extensionsRootType.xml
config/intellij-idea-latest/options/filetypes.xml
config/intellij-idea-latest/options/find.xml
config/intellij-idea-latest/options/find.recents.xml
config/intellij-idea-latest/options/jdk.table.xml
config/intellij-idea-latest/options/gemmanager.xml
config/intellij-idea-latest/options/github_settings.xml
config/intellij-idea-latest/options/gradle.run.settings.xml
config/intellij-idea-latest/options/extensionsRootType.xml
config/intellij-idea-latest/options/hg.xml
config/intellij-idea-latest/options/ignore.xml
config/intellij-idea-latest/options/markdown.xml
config/intellij-idea-latest/options/multimarkdown.local.xml
config/intellij-idea-latest/options/multimarkdown.shared.xml
config/intellij-idea-latest/options/options.xml
config/intellij-idea-latest/options/other.xml
config/intellij-idea-latest/options/packages.xml
config/intellij-idea-latest/options/pomodoro.state.xml
config/intellij-idea-latest/options/project.default.xml
config/intellij-idea-latest/options/proxy.settings.pwd
config/intellij-idea-latest/options/recentProjects.xml
config/intellij-idea-latest/options/recentProjectDirectories.xml
config/intellij-idea-latest/options/remote-servers.xml
config/intellij-idea-latest/options/runner.layout.xml
config/intellij-idea-latest/options/scratches.xml
config/intellij-idea-latest/options/stubIndex.xml
config/intellij-idea-latest/options/updates.xml
config/intellij-idea-latest/options/usageView.xml
config/intellij-idea-latest/options/vcs.xml
config/intellij-idea-latest/options/window.manager.xml
config/intellij-idea-latest/options/window.state.xml
# turn off those auto-update messages...
config/intellij-idea-latest/port
config/intellij-idea-latest/plugins/*
config/intellij-idea-latest/tasks/*
config/intellij-idea-latest/extensions/
config/intellij-idea-latest/jdbc-drivers/*
# region START UNIGNORE IntelliJ
!config/intellij-idea-latest/scratches/
!config/intellij-idea-latest/consoles/
config/intellij-idea-latest/consoles/.history/*
# General settings
# config/intellij-idea-latest/sonarlint/
config/intellij-idea-latest/javascript/nodejs/**
# config/intellij-idea-latest/options/editor.codeinsight.xml # has my autobracket disable
# endregion END UNIGNORE Intellij
This leaves fair number of files which are not blacklisted - plus I symlink my .idea files sometimes and version control those settings, although workspace.xml has a lot of stuff and it changes all the time (see https://youtrack.jetbrains.com/issue/IDEA-163348).
Also, keep your eye out for "Share" buttons like the one shown for a scope below, as these seem to control whether the setting is shared to a configuration.
The most elegant set up for settings configuration comes from VSCode - hopefully at some point Jetbrains will figure this out and copy them:

You can either 'Share settings through a settings repository' or you can 'Share your settings with the Settings Sync plugin'.
More details can be found at https://www.jetbrains.com/help/idea/sharing-your-ide-settings.html. If the link ever expires please let me know in the comments below.

Related

node red cannot GET /myfile from directory

I would like to ask.
I have file in C:\users\nxf68958\.Node-red\report.html
And when I would like to open this file by: localhost:1880/report.html
I get:
Cannot GET /report.html
in Log I have: "Nov 09:52:00 - [info] User directory : \Users\nxf68958\.node-red"
I am using:
NR: 3.0.2
Node: 18.12.0
It worked perfectly on older versions of: NR: 2.2 and Node: 16.13.
Then I actualized and it stopped working.
In settings.js is option: "fileWorkingDirectory" I tried to change it, but without change.
What I am doing wrong?
Thank you
Node-RED will not serve static files by default, you have to explicitly enable it by settings the httpStatic option in the settings.js file.
Settings the httpStatic value to point to the userDir (which is what you have basically done by setting it to __dirname) is a bad idea from a security point of view because this means anybody can download your flows.json and flows_creds.json files and the files like settings.js and .config.runtime.json (which holds the default encryption key for the creds file).
fileWorkDirectory is purely to set the default working directory for the code nodes that interact with the filesystem, it will have no effect on what files are served by the HTTP server.

How to speed up WebStorm

In huge project WebStorm (it can be other product of JetBrains) is always thinking and loading something.
This is really annoying me!
Here is my recipe how to speed up your lovely WebStorm:
Go to Preferences and do next:
Appearance & Behaviour > System Settings > Updates: disable auto update
Appearance & Behaviour > System Settings > Usage Statistics: Uncheck Allow sending data usage statistics to JetBrains
Editor > Live Templates: disable all, leave only what you are really use
Editor > Emmet: disable all emmets
Editor > Intentions: I leave only: CSS, Declaration, JavaScript and Language Injection
Plugins: leave only next (* - can be also disabled in case you don't need them):
CoffeeScript *
CSS Suport
CVS Integration
Git Integration
HTML Tool
IntelliLang
JavaScript Debugger *
JavaScript Intention Power Pack
JavaScript Support
NodeJS *
Perforce Integration
SASS suport *
Project > Directories: Exclude all what you don't use
Languages & Frameworks > JavaScript > Libraries: leave only: HTML and HTML5 / EcmaScript 5
Languages & Frameworks > Compass: disable it
Tools > WebBrowsers: leave only Chrome
Help > Edit Custom VM Options: Edit and increase usage memory pwd:
-Xms1024m
-Xmx1536m
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=512m
-XX:+UseCompressedOops
So the main idea is next: disable all in Preferences what you really don't use and increase memory for IDE.
There is a "Power Save Mode" setting in the files menu. This will disable some syntax highlighting and stuff, but will improve the speed of any JetBrains IDE.
Also check out ScriptedAlchemy's jetbrains-ide-performance github repository - and be sure to check out the updated settings in the issues.
Disabling unused global symbols (search for it in the settings, it's under inspections) also seems to help.

Safari Push Notifications - Verifying hashes in manifest.json failed even though correct

I have created a push package with the appropriate files as per the Apple spec for APNS. This manifest file represents all of the files that are present:
{
"icon.iconset/icon_128x128.png": "78609fcff69688f969a38f957ac2f10fc79d6732",
"icon.iconset/icon_128x128#2x.png": "78609fcff69688f969a38f957ac2f10fc79d6732",
"icon.iconset/icon_16x16.png": "d348589e2cf37d8f23940f8545afe75a2e98b4ac",
"icon.iconset/icon_16x16#2x.png": "d348589e2cf37d8f23940f8545afe75a2e98b4ac",
"icon.iconset/icon_32x32.png": "e4418a1c5f2ecfbb702961515aaa65d5449b1c53",
"icon.iconset/icon_32x32#2x.png": "e4418a1c5f2ecfbb702961515aaa65d5449b1c53",
"website.json": "45be9c4a6f1bf96e27a9eecab219304b35c5ac24"
}
I have manually checked the sha1 values on the CLI and they are all correct, along with the file locations. And yet I still get this error back from Safari each time I try to get permission:
{ '{"logs":': { '"Verifying hashes in manifest.json failed"]': '' } }
Which is not valid JSON either. Any ideas why this would be failing?
I recently implemented push notifications through pushwoosh. They automatically created the package for me and I checked how they done it. The only difference between mine manifest file and your is a back slash before the normal slash. Maybe it could do the difference for you. Copy and paste this code in your manifest (I have already added your SHA1 values):
{"icon.iconset\/icon_16x16.png":"d348589e2cf37d8f23940f8545afe75a2e98b4ac","icon.iconset\/icon_16x16#2x.png":"d348589e2cf37d8f23940f8545afe75a2e98b4ac","icon.iconset\/icon_32x32.png":"e4418a1c5f2ecfbb702961515aaa65d5449b1c53","icon.iconset\/icon_32x32#2x.png":"e4418a1c5f2ecfbb702961515aaa65d5449b1c53","icon.iconset\/icon_128x128.png":"78609fcff69688f969a38f957ac2f10fc79d6732","icon.iconset\/icon_128x128#2x.png":"78609fcff69688f969a38f957ac2f10fc79d6732","website.json":"45be9c4a6f1bf96e27a9eecab219304b35c5ac24"}
I created a small ruby script for generating these manifests based on the code in https://github.com/SymmetricInfinity/push_package/blob/master/lib/push_package.rb.
Copy the script into a directory containing an icon.iconset directory and your website.json. Then you can run ruby gen_manifest.rb inside that directory and the script will write the manifest.json. At the very least it may be a sanity check to see that everything is correct. The script is here: https://gist.github.com/adamvduke/7934457
If you don't have any ruby experience, comment back and I can walk you through it.

open_basedir restriction when parsing LESS files

I got a warning when parsing my "Twitter BootStrap" files and saving them on disk in my less-cache folder.
Warning: is_file(): open_basedir restriction in effect. File(/../../lib/bootstrap/less/reset.less.less) is not within the allowed path(s): (/var/www/vhosts/example.com/:/tmp/) in /var/www/vhosts/example.com/httpdocs/wp-content/modules/wp-less/lessc/lessc.inc.php on line 80
I'm using (for example) #import "../../lib/bootstrap/less/reset.less"; in the main file that I'm parsing.
The funky thing is, that the first stylesheet gets the extension two times: reset.less.less - the other ones not. Another thing that keeps me wondering, is why the heck there's a leading / in front of the files.
Some data about the environment and server:
PHP 5.3.3
Wordpress 3.4.2
The WP-LESS Plugin (yes, I commit to this repo), which uses the LESSc library - which throws the error from here.
php.ini
include_path = ".:..:"
upload_temp_dir _no value/not set_
open_basedir = "/var/www/vhosts/example.com/:/tmp/"
Thanks for any help in advance!

XUL standalone application not starting

I recently took on a project built on XUL (standalone, using xulrunner) - However I can't get it to properly run.
I'm getting this error when I attempt to start it using the command line (xulrunner.exe ../application.ini -jsconsole):
No chrome package registered for chrome://case_scenario_builder/content/case_scenario_builder.xul
The chrome.manifest file looks like this:
content case_scenario_builder file:chrome/case_scenario_builder/content/ contentaccessible=yes
content jslib jar:chrome/jslib.jar!/
skin case_scenario_builder skin file:chrome/case_scenario_builder/skin/
locale case_scenario_builder en-US chrome/case_scenario_builder/locale/en-US/
Any ideas on where I could start debugging?
I figured it out!
In case anyone else runs into this as well:
It was due to the caching system in place by default and the use of .jar containers instead of folders.
The XUL environment had cached both JS and XUL files - and even after disabling those, I had to extract everything that was in the .jar file to the content folder and update the chrome.manifest file.
Thanks for your suggestions on debugging! - they helped the process.
I guess your manifest just isn't getting loaded. To test that I'd introduce an intentional syntax error and check the error console. E.g. if you put
asdfasd
on its own line, you should get a Warning: Ignoring unrecognized chrome manifest directive 'asdfasd'. in the Error console.
(Note to other experts: initially I wanted to suggest dropping 'file:' prefix and avoiding underscores in the package name, but I tested it on a Firefox nightly, and it works fine.)
Your chrome package clearly didn't get registered. From what I can tell, the reason is the bogus file: prefix, you should drop it when specifying relative paths:
content case_scenario_builder chrome/case_scenario_builder/content/ contentaccessible=yes
Btw, I suspect that you copied contentaccessible=yes from somewhere - you should drop it as well unless you know what it does.