Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
nojhan
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
An elegant and readable Game of Life implemented in python
(github.com)
3 points
by
nojhan
12y ago
|
0 comments
2.
▲
Simple and elegant declaration and localization of exceptions in C++
(github.com)
1 points
by
nojhan
13y ago
|
0 comments
3.
▲
Best way to implement functors: inheritance VS CRTP?
(github.com)
1 points
by
nojhan
13y ago
|
0 comments
4.
▲
by
nojhan
13y ago
That's because the log was already colored (the word "fail" in red). As colout tries to color the whole line, the previous end escape character is interpreted by the terminal before the last one : <red>* This is a
5.
▲
by
nojhan
13y ago
You've got a too old version, update to the current one and you will see something like: [:~/code/colout/colout] parse_r+* ± colout -r x Available resources: STYLES: reverse, bold, italic, normal, conceal,
6.
▲
by
nojhan
13y ago
That's a bug I'm still trying to fix, but the argparse module made it somewhat difficult to find an elegant solution. An easy workaround is to indicate a fake pattern argument: colout -r x
7.
▲
by
nojhan
13y ago
You use the "zero or more" * operator, which will match empty strings in front of the "%". But an empty string cannot be converted to a float. Just use the "at least one" operator: +. Also, the scale is 0,100 b
8.
▲
by
nojhan
13y ago
It's not really a replication, as colout just _USE_ the pygments library. Colout just add the possibility to color code that is located inside a text that should not be colored, which pygmentize cannot do: colout -a -s Python monokai
9.
▲
by
nojhan
13y ago
There is some incompatibility, like the gettext module in the g++ theme, the way themes are imported, unicode support, the print statement… But maybe it's still possible to write a code that work on both versions?
10.
▲
by
nojhan
13y ago
You can, it's just a matter of knowing how to write a function for your shell.
11.
▲
by
nojhan
13y ago
It should not be too difficult to use the same config files in colout, btw.
12.
▲
by
nojhan
13y ago
The `-h` switch show the help, but the `-r` show the resources loaded at startup. Alias for common use cases are named "themes" in the list of resources.
13.
▲
by
nojhan
13y ago
Indeed. Having to build configuration file for each command was a pain in the ass. Colout is better integrated in my shell workflow and shows that config files are not mandatory (but colout themes do just the same). Plus, colout have a tons
14.
▲
Colout – add colors to a text stream in your terminal
(nojhan.github.io)
116 points
by
nojhan
13y ago
|
40 comments
15.
▲
by
nojhan
13y ago
To be honest, just because I've tried to pass this link in hackernews several times without success, with different combination of keywords/users. I was a little bit shameful at the beginning, but the overwhelming success (from the perspect
16.
▲
by
nojhan
13y ago
That's amusing, because I've started liquidprompt for this very specific reason: I was constantly missing the battery notification icon. Time seems to have trained my brain not to look at this screen area. Fortunately, with liquidprompt ale
17.
▲
An adaptive prompt for Bash and Zsh
(github.com)
68 points
by
nojhan
13y ago
|
21 comments
18.
▲
by
nojhan
13y ago
I've proposed a PR that do just that (maybe a little bit more readable): https://github.com/paulsm/bashtime/pull/1 Also, the code is now used in the liquid prompt: https://github.com/nojhan/liquidprompt/commit/91959b636af751...
19.
▲
Rethinking the command line prompt
(github.com)
3 points
by
nojhan
14y ago
|
0 comments
20.
▲
Liquid prompt — A useful adaptive Bash prompt
(github.com)
2 points
by
nojhan
14y ago
|
0 comments