Add time on ohmyzsh console on robbyrussell theme - oh-my-zsh

Very simple problem, i would like to see the time when i prompted my commands in the ohmyzsh console. I use the robbyrussell theme and would prefer to keep it if possible.
Thanks !

You can try
PROMPT="%D{%m/%f/%y}|%D{%L:%M:%S}"
See more at https://superuser.com/questions/943844/add-timestamp-to-oh-my-zsh-robbyrussell-theme/943916

Related

How to enable statusBarItem right away in vscode extensions API

I have some extensions code in extension.ts
const item = vscode.window.createStatusBarItem(
vscode.StatusBarAlignment.Right
);
item.command = "codevids-auth.pushToWebview";
item.text = "$(record) codevid";
item.show();
I can't figure out how to place the statusBatItem in automatically without having to fire the command. Is this possible since some plugins as soon as they are installed they show up in the statusbar. I would like to know how to do this.
Thanks for the help ahead of time. And please let me know if you need more details I am happy to explain further.
It sounds like you may not be using an activationEvent which would trigger your extension's activate function immediately after startup is finished. Try this:
"activationEvents": [ "onStartupFinished" ]
Then your code, which includes .show(), should be sufficient to show the StatusBarItem soon after vscode is reloaded or started. It is typical that installation of an extension is not enough to activate it, the user should get a badge on the Extension view that reload is required. If that is what you are trying to avoid, I don't think it is possible.

Visual Studio Code Formatting fail on save

I've started learning React Native.
I'm using Visual Studio Code as my editor.
I've set up the boiler plate and started the app. But whenever I change a .js file and hit save, VSCode is messing up all the formatting.
I thought I could sort this in the settings.json file but after googling for a while and playing around I can't find the correct setting.
Is this a bug or am I doing something wrong?
Setting file is default one:
UPDATE: I re-installed vscode. Then set up a basic js file with a react native tag and a html tag. I added in:
"editor.formatOnSave": false,
"javascript.format.enable": false
To my settings.json file and the problem still occurs:
The problem is having tags in a js file, I just don't know how to tell vscode to ignore them?
I found out what this was by looking though the extensions. Thanks to #wgj for the hint.
Turns out it was the JS-CSS-HTML formatter. I looked through the instructions and have removed the auto save for now. I'll have to work out the specific settings for this.
It uses js-beautify so if anyone knows the settings I should be looking at would be much appreciated.
I had a similar problem and it turned out my ultimate culprit was...
So I simply disabled it for the workspace.
Same here, all my HTML format messed up after saving, I disable "JS-CSS-HTML Formatter" and problem solved
In the end, what did the trick was changing the file format from JavaScript to JavaScript React on the bottom toolbar.
All my HTML format messed up in js after saving, I disable "JS-CSS-HTML Formatter" and restarted vscode, problem solved.
I found my solution to this problem by converting my components file extension from js to jsx. No more issues and everything is working fine.
Disable js-css-html formatter.
if you are using prettier and beautify together, override the setting as :
"beautify.ignore": [
"**/*.js",
"**/*.jsx"
]
Use Prettier Code Formatter instead of Beautify. Works perfectly for language mode Babel JavaScript
You should search for "format" in settings.json. You'll find a whole lot of TypeScript/JavaScript formatting tweaks in there, but the one that stands out to me is:
// Defines space handling after opening and before closing non empty brackets.
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false
Alternative, you're not a fan of formatting at all, you can turn it off entirely:
// Enable/disable default JavaScript formatter.
"javascript.format.enable": true,
However, a lot of my formatting options come from language server extensions, so if you're using one for React Native specifically, be sure to check the attributes in settings.json, or the docs to see if there are any attributes you can add.
Add this on settings.json file. Whether you are using any extension or not, use this code. It works fine for me:
Solution 1: Just Disable JS-CSS-HTML Formatter
Solution 2: Press Ctrl+, (open settings) after that search Code formatted and change none --> Prettier
If you don't have prettier install from the extension's marketplace.
i just had this problem , apparently its because of the beautify/prettier , try to disable both , then restart Vs code (your editor) . but then if u really want to use prettier , go under its extension settings and make sure its in strict with whitespaces and toogle around a few other settings and you should be fine , cheers .
Just turning off format on save option from the settings would work.
You can select JavaScript React in the task bar under Select Language Mode.
You can try one of the following
uninstall other formatters which are not required. To check how many formatters you have just press ctrl + shift + p or command +shift + p (mac) and type format document after that a menu will appear showing you your formatters
press ctrl + shift + p or command +shift + p (mac) and type settings and click on open users settings and then search for format on save and check the box
that's it!!
Enjoy
changing the file format from JavaScript to JavaScript React on the bottom toolbar worked just fine for me
I have tried all methods but the problem is solved completely by this:
-> Open setting.json
-> "files.associations": {
"*.js": "javascriptreact"
}
->Add above lines and press save the problem will solve
You can type the following command string when creating your project
npx create-react-app name-of-app react-complete-guide
or the following, if you have create-react-app installed already
create-react-app name-of-app react-complete-guide

IntelliJ output console INFO colour

Does anyone know why IntelliJ is printing all log messages to my console in red coloured text? This make it really hard to distinguish between info and trace messages and the actual error messages that I need to see!
I'm using Tomee and CDI if this is relevant!
Thanks for your assistance,
Edit
My setting all look okay within the preferences window:
I have stacked with the same problem too. For now I'm using Intellij IDEA 2016.1 and there are no such opportunity to color logs the way you want.
For me I have solved it by using Grep Console Plugin and recommend it to you.
It's easy to install and use.
Before
After
I had exactly same problem. Not sure about your case, but mine was following:
I use SLF4j Simple Logger Facade in my projects (because it is simple, yup). So it turned out that if you don't specify org.slf4j.simpleLogger.logFile property in simplelogger.properties file located in your resources folder (as well as if you don't have that file at all), the logger output defaults to System.err which is red in Idea.
The solution proposed by #pavlo sort of helped, but the base colour was still red.
So I added this line to src/java/main/resources/simplelogger.properties:
org.slf4j.simpleLogger.logFile=System.out
and installed Grep Console Plugin. Together they perfectly solve the problem with SLF4j Simple Logger.
I found that if I map the Console Colors for Bad command or filename to my preferred Logger.INFO color, it works fine.
This is an issue that needs fixing, for for now this workaround works for me.
This can also be solved by adding the following VM option to your run configuration.
-Dorg.slf4j.simpleLogger.logFile=System.out

unable to execute pig script for Hue-2.5.0

I have installed Hue-2.5.0 in pseudo mode and also i am able to view the UI.
Beeswax(hive UI), sqoop, oozie editor everything are working efficiently but i dont know why my pig scripts are not working, UI is non resrponsiv & it is not showing any errors or exceptions.
i have checked logs also and found no issue
what could be the issue???
thanks in advance.
You should look at http://hue_host:8888/logs, or right click and 'inspect element' and look for error in the Chrome console. You can also share a screenshot of what happens when you clicked 'submit. Feel free to comment on the hue-user list too.

JSLint, when using JS frameworks

I use the Dojo framework, which I load from an url.
How should I deal with the 'dojo' was used before it was defined errors, and the alike?
Yes, my feeling really get hurt, when running code through JSlint.
Perhaps you can put something like
/* globals dojo */
in the beggining of your file to tell JSLint that dojo exists?
I personaly use JSHint (a fork of JSLint that is less nitpicky) instead and one of the preconfigured options is support for Dojo.
Sounds like you need to put Dojo first in your JavaScript. The message suggests that you have an ordering problem.
Don't take it personally. You are not your code. Just make it better, learn something, and don't do it again.
If you scroll all the way down to the bottom there is a "predefined" textbox. Simply put in any of the variables you need into there (comma separated).