I'd like to override the disallowMultipleVarDecl property in linter-jscs. I tried doing the following in .jscsrc:
{
"preset": "airbnb",
"esnext": true,
"requireTrailingComma": null,
"disallowMultipleVarDecl": false
}
I've quit (not x-ed out) Atom and re-opened it multiple times, and I'm still getting an error:
How can I override this disallowMultipleVarDecl property?
Related
How can I in my .eslintrc.js file set what global variables are uesed, eslint-plugin-import is returning an error -> 3:30 error Unable to resolve path to module 'config' import/no-unresolved. Another way would be to ignore 'config' I guess?
Kind regards
If I set
'import/no-unresolved': 'off'
then obviously it's working but not as intended, I want the rule to exist just not for global variables.
You can define globales like this
{
"globals": {
"foo": true
}
}
I am trying to enable default MFA for Openstack user using Python keystoneclient API
keystoneclient.users.update
I have sample API curl command from Openstack documentation, where you update the "options" attribute of user account with JSON object
{
"user": {
"options": {
"multi_factor_auth_enabled": true,
"multi_factor_auth_rules": [
["password", "totp"]
]
}
}
}
when I am trying to update the same in Python code I am getting below error
keystoneauth1.exceptions.http.BadRequest: Invalid input for field 'options': u'{ "multi_factor_auth_enabled": true,
"multi_factor_auth_rules": [["password", "totp"]]}' is not of type
'object'
Failed validating 'type' in schema['properties']['options']:
my code is like this
MFA_dict = '{ "multi_factor_auth_enabled": true, "multi_factor_auth_rules": [["password", "totp"]]}'
user = keystone.users.update(user_id, options=MFA_dict)
Never mind I figured it out.
MFA_dict was string, so I had to just remove single quotes and make the object dictionary.
and make lower case true into uppercase True to make it boolean
MFA_dict = { "multi_factor_auth_enabled": True, "multi_factor_auth_rules": [["password", "totp"]]}
When minifying meteor app, safari on IOS 10 throws the following error
SyntaxError: Cannot declare a let variable twice: 't'.
I have tried to remove standart-minifier and added abernix:standart-minifier as it was recommended on this comment - they work fine on all the other browsers but on safari ios10 it crashes.
Do you have any recommendations?
Thanks a lot
Edit:
I ended up removing minify packages as it was mentioned here however it definitely not a long-term solution.
The solution to this ios10 safari bug is
here
Problem is caused by minify default option
safari10:false
to solve the problem
find these files
/Users/USER/.meteor/packages/abernix_standard-minifier-js/.2.1.0.1v4h096++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/abernix_minifier-js/node_modules/uglify-es/lib/minify.js
and
/Users/USER/.meteor/packages/abernix_minifier-js/.2.1.0.106pai4++os+web.browser+web.cordova/npm/node_modules/uglify-es/lib/minify.js
then find the following lines and change it as "safari10:true"
if (options.mangle) {
options.mangle = defaults(options.mangle, {
cache: null,
eval: false,
ie8: false,
keep_classnames: false,
keep_fnames: false,
properties: false,
reserved: [],
safari10: true,
toplevel: false,
}, true);
}
I installed Sublime Text 3. I installed Package Control, R-Box, SendText, SendCode, sublimeREPL, and 1337 Color Scheme. To test that REPL R is working I ran the code:
getwd()
The output was
R:/R_WD.
That's the correct location.
What I want to do is send code from one window to REPL R and have it evaluated. It originally would send code to the REPL R window and I could run the code but I wanted to be able to have it run automatically. I tried looking on forums for ideas and changed some settings. Now it will not send code to REPL R.
Here are my settings:
Preferences --> Package Settings --> R-Box --> Settings:
{
// enable auto completions
"auto_completions": true,
// show popup hints
"show_popup_hints": true,
// path to Rscript, for example
// (mac, linux): "/usr/local/bin/Rscript"
// (windows): "C:\\Program Files\\R\\R-x.y.z\\bin\\Rscript.exe"
"rscript_binary": null,
// additional paths to PATH variable
"additional_paths": []
}
User:
{
"prog": "Cmder",
}
Preferences --> Package Settings --> SendText --> Settings---> Default:
{
// Uncomment the program you want send text to:
"program": "Terminal.app",
// "program": "iTerm",
// "program": "tmux",
// "program": "screen",
"paths":
{
// It might be necessary to explicitly set path (usually /usr/bin
// or /usr/local/bin) to tmux and screen. Uncomment below and specify
// the correct path:
// "tmux": "/usr/local/bin/tmux",
// "screen": "/usr/local/bin/screen"
}
}
Preferences --> Package Settings --> SendText --> Settings---User:
{
"prog": "Cmder",
}
Preferences --> Package Settings --> SendCode--> Settings:
{
"prog": "Cmder",
}
Preferences --> Package Settings -->SublimeREPL--> Settings---Default:
{
// default_extend_env are used to augment any environment variables
// that should be visible for all subprocess repls launched within
// SublimeREPL. This is a very good place to add PATH extension
// once "PATH": "{PATH}:/home/username/mylocalinstalls/bin" or whatever
"default_extend_env": {},
// Specify whether to move repls to a different Sublime Text group (frame)
// immediately on opening. Setting this to true will simply move it to
// the 'next' group from the one that was in focus when it was opened
// (one down with row layout, one to the right with column and grid
// layout). Alternatively, you can set this to the index of the group in
// which you want all repls to be opened (index 0 being the top-left group).
// Activating this option will NOT automatically change your layout/create
// a new group if it isn't open.
"open_repl_in_group": true,
// Persistent history is stored per REPL external_id, it means that all python
// REPLS will share history. If you wish you can disable history altogether
"persistent_history_enabled": true,
// By default SublimeREPL leaves REPL view open once the underlying subprocess
// dies or closes connection. This is useful when the process dies for an unexpected
// reason as it allows you to inspect it output. If you want. Setting this
// to true will cause SublimreREPL to close view once the process died.
"view_auto_close": false,
// On POSIX system SublimeText launched from GUI does not inherit
// a proper environment. Often leading to problems with finding interpreters
// or not using the ones affected by changes in ~/.profile / *rc files
// This command is used as a workaround, it's launched before any subprocess
// repl starts and it's output is parsed as an environment
"getenv_command": ["/bin/bash", "--login", "-c", "env"],
// Some terminals output ascii color codes which are not currently supported
// enable this option to filter them out.
"filter_ascii_color_codes": true,
// Where to look for python virtualenvs
"python_virtualenv_paths": [
"~/.virtualenvs", // virtualenvwrapper
"~/.venv" // venv.bash https://github.com/wuub/venv
],
// Use arrows for history navigation instead of Alt+[P|N]/Ctrl+[P|N]
"history_arrows": true,
// standard sublime view settings that will be overwritten on each repl view
// this has to be customized as a whole dictionary
"repl_view_settings": {
"translate_tabs_to_spaces": false,
"auto_indent": false,
"smart_indent": false,
"spell_check": false,
"indent_subsequent_lines": false,
"detect_indentation": false,
"auto_complete": true,
"line_numbers": false,
"gutter": false
},
// this settings exposes additional variables in repl config files, especially
// those related to sublime projects that are not available through standard API
// WARNING: this will switch your build system back to Automatic each time a REPL
// is started so beware!
"use_build_system_hack": false,
// IP address used to setup autocomplete server in sublimerepl.
// changing this is usefull when you want to exclude one address
// from proxychains/tsocks routing
"autocomplete_server_ip": "127.0.0.1",
// Mapping is used, when external_id of REPL does not match
// source.[xxx] scope of syntax definition used to highlight
// files from which text is being transfered. For example octave
// repls use source.matlab syntax files and w/o this mapping text transfer
// will not work
"external_id_mapping": {
"octave": "matlab"
},
// If set to true, SublimeREPL will try to append evaluated code to repl
// output before evaluation (e.g. Ctrl+, f)
"show_transferred_text": true,
// If set to true repl view (tab) that receives text for evaluation will
// be brought to front after text transfer. Note: This will not fire if repl
view
// is in the same tab group as the view from which the code is sent.
"focus_view_on_transfer": true
}
Preferences --> Package Settings -->SublimeREPL-->Settings--- User:
{
"default_extend_env": {"PATH": "{PATH};R:\\R_WD\\R\\R-3.4.2\\bin\\x64"},
"show_transferred_text": true
}
I noticed that the comments said to uncomment or add code but I can't seem to edit the code in those locations.
Any help is appreciated. If there is any clarification needed, I'm happy to provide more info.
This is how I changed the code to get it to work:
I changed "Preferences --> Package Settings --> SendText --> Settings---User:" from:
{
"prog": "Cmder",
}
to:
{"r" : {
"prog": "cmder",
}
{ "rscript_binary" : "R:\\R_WD\\R\\R-3.4.2\\bin\\Rscript.exe"
}
}
All the other user settings code that was:
{
"prog": "Cmder",
}
I changed to:
{"r" : {
"prog": "cmder",
}
}
I can now send the code to be automatically evaluated with the default option.
I'm trying to compile my js files using closure compiler, but it's giving me this error:
ERROR - goog.getMsg() function could be used only with MSG_* property or variable
my closureCompiler options are:
closureCompiler: {
options: {
compilerFile: 'temp/compiler.jar',
compilerOpts: {
compilation_level: 'ADVANCED_OPTIMIZATIONS',
//compilation_level: 'WHITESPACE_ONLY',
language_in: 'ECMASCRIPT6',
language_out: 'ECMASCRIPT5_STRICT',
formatting: 'PRETTY_PRINT',
externs: ['src/js/compiled/react-extern.js'],
warning_level: 'verbose',
summary_detail_level: 3,
output_wrapper: '"(function(){%output%}).call(window);"',
create_source_map: 'src/js/compiled/output.js.map',
manage_closure_dependencies: true,
use_types_for_optimization: null,
debug: true
},
execOpts: {
maxBuffer: 999999 * 1024
}
},
compile: {
//src: 'src/js/debug/**/*.js',
src: [
'temp/closure-library/closure/goog/base.js',
'src/js/compiled/test.js'
],
dest: 'src/js/compiled/compiled.js'
},
},
I believe I'm missing a flag, but I don't which one to write ?
You can't include goog.getMsg() in your code.
It has to be:
var MSG_SOMETHING = goog.getMsg('something');
and use the MSG_SOMETHING instead.
Google Closure Compiler enforced that, so you could write all your variable in one file and send this one to get translated.