How to have Go coverage HTML with light background? - go

Consider the following command:
go tool cover -html=coverage.out
Is there a way to make the resulting HTML dark on light (rather than the default light characters on dark background)?
I did not find anything about this neither in the documentation nor in the help pages referenced therein (go tool cover --help and go help testflag)

Not with the built-in tool. There's nothing preventing you from piping the output through some script to change CSS colors, though, or to reference an external CSS file that sets the colors you prefer.

As mentioned by #Flimzy, this is not supported with the built-in tool.
Though, looking at the coverage.html file output by the cover tool.
You can do something like this:
go tool cover -o coverage.html -html=coverage.out; sed -i 's/black/whitesmoke/g' coverage.html; sensible-browser coverage.html
which will write the output to coverage.html using the -o flag and then use sed to change occurrences of black to whitesmoke. It will then use your default browser to open the file.
Note #1: Obviously, this will not work once the tool is updated not to output black color background. Though, if this changes, there is probably a lot better support for different color schemes.
Note #2: If you use heat maps -covermode=count, the light green might look awkward on the smokewhite color. Feel free to try different color accents though.

Related

how to change background color in scite (scintilla) editor

In frustration of some breakage, I've nuked my old/ancient
version of Scite, and done a fresh install of Scite.
So, on Windows, I now have 32-bit version 5.1.4.
Three issues:
#1 How/where to change the overall (not file-type specific)
background color, it defaults to WHITE. I'd like to configure it to that light-yellow-ish color. How/where to
do that. (Googling said to change it in the "SciTEGlobal.properties" file, but nothing in there resembles what I'm trying to do. !?!?)
#2: So, specific to HTML files, as I scrolled down thru a file, the background in HTML sections would have this same light-yellowish color, and the JS sections had white background, and I'd like to have something equivalent
to that. (On the defaults I see now, html sections are white, but the JS section are an off-white, but they are
so close to white, that my eye can hardly discern them, unless I tip the laptop's screen back and forth. (Yuck.)
#3: A new behavior I see now, is that there is some scheme for html, that uses different font-sizes for different contexts. While that seems like a worthwhile feature for many, I'd like to go back to what I had before...where
all lines were the same font-size. (And then, how can I specify just one single font-size, for all lines in all file-types.)
TIA...
Dave
Default background color and style can found in SciTEGlobal.properties file
# Global default styles for all languages
# Default
style.*.32=$(font.base)
# Line number
style.*.33=back:#E7E7E7,$(font.base)
To change default background color open SciTEUser.properties file and add following lines
# Global default styles for all languages
# Default
style.*.32=$(font.base),back:#101010,fore:#BBBBDD
# Line number
style.*.33=$(font.base),back:#101010
Note: Editing SciTEUser.properties file for customization is best practice. However this file is stored under %USERPROFILE% folder (in Windows) and customization limited to that machine only. If your SciTE installation is on USB stick (Portable installation) and you want to retain SciTE customization on whichever PC you plugged in then edit SciTEGlobal.properties
To do any changes specific to any language then edit <language>.properties file.
example html.properties for HTML specific customization.

Set Different Terminal Background for Each Directory

I seem to recall stumbling across an article on zsh about how it was possible to have different themes (or presumably, different theme settings, for different directories). In other words, you'd be able to do things like set the background color of the terminal to be blue for one directory, black for another, etc. I couldn't find the original article or anything matching what I had in mind.
Is this something that can be done?
I suggest using LS_COLORS, you can select highlighting, emboldening and different colours very quickly and easily.
heres a great tutorial on how to do that;
https://www.howtogeek.com/307899/how-to-change-the-colors-of-directories-and-files-in-the-ls-command/
It is also possible to edit the bash_profiles. script line;
export BASH_IT_THEME="whichever theme you have"
And insert a downloaded theme but this would be for your whole system (as far as I know)

How can you embed multiple SVG images in a print layout using a scripted procedure?

I currently have a script that produces a large amount of 3.5-inch-square SVG images. What I need is to be able to put these SVGs in a layout which can be easily and accurately printed.
I have tried using an HTML template, but HTML/CSS does not have sufficiently robust printing support.
What document layout language is most appropriate for handling SVG images, and how could this be implemented in a scripting language?
I use Ruby to generate my SVGs, and although preferable, it is not required that Ruby also be the language used to generate the print layout.
I'd suggest compiling all SVGs to a larger SVG, placing everything where you want it, and convert that to PDF using one of multiple options:
Using Inkscape on the command line, like
inkscape -f in.svg -A out.pdf
Using Batik
java -jar batik-rasterizer.jar -m application/pdf -d out.pdf in.svg
Using librsvg, like
rsvg-convert -f pdf -o out.pdf in.svg
(Probably the most lightweight option)
You might also be able to use the rsvg2 Ruby gem with a Cairo PDF surface. Documentation seems scarce or scattered, though.
If you have a budget, Prince is what you want. Since you've already tried to use CSS+HTML to get it working, you may have a working solution almost ready. Just generate the HTML, SVG, and CSS (use the CSS3 paged media extensions for best control), then pass it off to Prince to generate the PDF. I've used this for several projects, and it works great.
There are free options that work like Prince, notably wkhtmltopdf, but they might not respect your paging options as much as Prince.
Otherwise, you might be able to hack something together using Cairo, by creating a page-sized SVG image and laying it out, adding links to the multiple external SVG files.
Either of these options will end up generating a PDF, which is the only way to ensure that it will print the same no matter which browser or OS is being used.

Change Clang's colored output

Is it possible to change Clang's choice of colors for their colorized diagnostics?
I like my terminal to have a black background, but I just noticed that I was missing Clang's helpful diagnostic messages. I'm aware of the the -fno-color-diagnostics compiler option but I would prefer to have the colors, just different colors. Any solutions?
I'm using a bash shell in OSX. Thanks.
It looks like the colors are hard-coded near the beginning of this file (include file). You can edit the file and recompile the program, write and submit a feature that accepts color settings at the command line, in an environment variable or from a file, or non-portably try to substitute the colors on the fly.
Here is an example of the latter:
clang ... | sed 's/\o33\[30m/\o33[37m/g'
That changes black to white for XTerm escape sequences. Some other sequence would need to be used for other terminal types.

ImageMagick - Auto adjust the colours of an image a la other photo management applications?

Several photo management applications (e.g. Picnic on the flickr website, F-Spot on the gnome desktop), has the option to 'autocorrect'/'auto-fix' an image, which seems to adjust the colours in an image to make it look a bit better.
For example, here's a before:
and after
Is there anyway to do this sort of 'automatically adjust the colours to make it look good' on the command line with ImageMagick's tools (or other open source command line tools on ubuntu/debian). I have several hundred images that look at bit rubbish and I want to try putting them through this sort of filter.
Alternatively, what would be the name of this sort of effect?
What you are looking for is something to help you correct the white-balance of photos.
If you search for imagemagick auto white balance on any popular search engine you will get quite a feew results that are relevant. Sadly, http://www.imagemagick.org seems down at the moment.
I myself found a shell script called autowhite, and used it
me#sophie:[...]$ ./autowhite.sh 5498758807_59a80b3c50_m.jpg corrected.jpg
and the result is perfectly acceptable:
Original:
Corrected:
There are some options to the script, so if you're not really satisfied with the result you'll able to tweak it a tad.

Resources