In the middle of the desert you can say anything you want
pwd | xc
alias pwx='pwd | xc'
I really need to gather them all in one place and make ~/.zshrc cleaner and neater.
```
cc() python3 -c "from math import *; from statistics import *; print($*);"
alias cc='noglob cc'
```
Added `statistics` to it, now I can do things like `cc mean([2, 4, 9])`. (As a bonus `stdev()` etc., [full list](https://docs.python.org/3/library/statistics.html)). Works for now. `"`, if any, have to be escaped.
## zsh prompt
Yet another change (theme file `clean2.zsh-theme`):
`PROMPT='%{$fg[green]%}(%*/%!) %{$fg[$NCOLOR]%}%B%b%{$reset_color%}%{$fg[blue]%}%B%5c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '`
It transforms to:
`(10:23:09/10712) some/folder/whatever/ $ mycommand`
Removed the user (that I had to edit out often), moved current time from `PROMPT` to the left side (now I can happily copypaste CLI args and output again).
## regex greedy / lazy
[Regex Quantifier Tutorial: Greedy, Lazy, Possessive](https://www.rexegg.com/regex-quantifiers.html) TODO
TL;DR most regex engines are greedy by default. Greedy = 'longest possible match'. Making it lazy sometimes means adding a "?" to the quantifier, such as `.*?`. Not supported everywhere, notably grep does this only with the perl syntax (`grep -P .*?`).
For vim: [regular expression - How to make regex matchers non-greedy? - Vi and Vim Stack Exchange](https://vi.stackexchange.com/questions/196/how-to-make-regex-matchers-non-greedy/13363#13363)
## `info` command instead of `man`
Nice, had no idea this existed. `info diff`, for example.
Found here: [linux - Understanding of diff output - Unix & Linux Stack Exchange](https://unix.stackexchange.com/questions/81998/understanding-of-diff-output).
## Unified diff how to read
`@@ -1,4 +1,5 @@`:
> - The number after the comma is the length of the chunk (in the old or new file), and
> - the number before the comma is the line number for the beginning of the chunk.
> - The + and - signs refer to adding and deleting lines, respectively. [^sounce]
[^sounce]: [What do the numbers in the @@ line mean in output of diff? - Unix & Linux Stack Exchange](https://unix.stackexchange.com/questions/252927/what-do-the-numbers-in-the-line-mean-in-output-of-diff?noredirect=1&lq=1)
Gnu diff man page has more: [Detailed Unified (Comparing and Merging Files)](http://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html)
## Git / Jira / Bitbucket branches and connections to tickets
As long as the branch name contains the issue key (ABCD-123), it gets connected - but only if the branch is created _after_ the creation of the ticket. [^jibbranchsource]
> As stated previously in this question, it is not possible. You are screwed if you create the branch first.
But also it seems that mentioning an issue name in the pull request (does this work for commits?) also works:
> Simply renaming the Pull Request in Github to include the issue id XXX-nnn in the name triggered that PR and Branch to be linked to the Jira ticket. [^jibbranchsource]
[^jibbranchsource]: [Solved: How to link existing JIRA issue to a existing bran...](https://community.atlassian.com/t5/Jira-questions/How-to-link-existing-JIRA-issue-to-a-existing-branch-in/qaq-p/701496)
## Random / i3 / workspaces
I could define a workspace officially, like number 5, for terminals I don't really need but that are open in deep folders I might need later.
## Random / documentation / dtb
Sometimes I miss the ability to drag and drop screenshots to my textfile with descriptions of stuff I did. I can drag and drop screenshots but they are a bit ephemeral. An interesting idea would be create a different keybinding that creates screenshots that get put in a particular folder; I can still drag-and-drop them, but I'll have stricter guarantees that they'll be there when I'll look for them.
## vim plugin MultipleSearch
[MultipleSearch - Highlight multiple searches at the same time, each with a different color. : vim online](https://www.vim.org/scripts/script.php?script_id=479)
```
:Search sth
:Search somethingelse
:SearchReset
```
Highlights them in diff colors, just what I need. `n/N` works only on the last one.
[vim-scripts/MultipleSearch2.vim: Improve Multiple search](https://github.com/vim-scripts/MultipleSearch2.vim) looks like an improved version of the above.
## vim search and substitute
You can use `\1` etc for `%s/..` commands, if the groups where previously defined by you in a usual `/search-for-stuff`!
```
/\v(https?):\/\/(.{-})\/.* <-- Search
:%s,,Protocol:\1 - Domain:\2,g <-- Substitution
```
This is awesome.
Tickets are linked automatically when mentioned like WHAT-1234
, but only with spaces around them; WHAT-1234: result
, for example, wouldn’t work.
alias sumup='paste -sd+ | bc'
This is nice! sort -V
sorts by “version numbers” => 1, 10, 20, 50, 200, instead of the alphabetic 1 10 20 200 50.
I need something like “output to CLI and copy to clipboard” + I need a smaller timestamp and to the left, not right-aligned, so I can more easily copypaste stuff.
I think part of the problem is people being raised to believe that love, in the biochemical sense, is the most important part of a relationship. Hence when they start feeling similar feelings for others, their relationship can weaken. But a relationship can be about so much more than just the biochemical side: two people, with similar goals and values, working together to build a better life for themselves and their children, and to help each-other achieve their dreams. 1
Zersetzung - Wikipedia “(German for “decomposition”) is a psychological warfare technique used by the Ministry for State Security (Stasi) to repress political opponents in East Germany during the 1970s and 1980s.”
TL;DR Download speed with ethernet is 4x faster, no differences otherwise.
Sa 17 Okt 2020 17:15:44 CEST.
Wifi, 50cm from router:
$ speedtest-cli
Retrieving speedtest.net configuration...
Testing from [redacted]
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by [redacted]: 46.246 ms
Testing download speed................................................................................
Download: 101.10 Mbit/s
Testing upload speed......................................................................................................
Upload: 3.64 Mbit/s
Ethernet from same router:
$ speedtest-cli
Retrieving speedtest.net configuration...
Testing from [redacted]
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by [redacted]: 40.086 ms
Testing download speed................................................................................
Download: 395.90 Mbit/s
Testing upload speed......................................................................................................
Upload: 3.89 Mbit/s
alias ccd='pwd | xc'
; though I kinda feel the task would be solved nicely as keyboard shortcut for kitty. + Reminder to myself that zsh nicely cd
-s to it when pasting the folder, without cd.
Also find | grep
is now f
instead of ff
.
“Du spricht für uns alle”
Forgetting about this nice use of grep:
grep "whatever" *
gives the matches while also displaying the filename!
And yet another place to find this! :actionlist
as command in ideavim.
IdeaVIM Help: motion is the last readable docu I can find, from 2006.
gi
starts insert mode at the last place insert mode was exited; '^
just moves the cursor there.
Had an issue with “Class not found” when running tests, fixed with “Invalidate caches and restart”
My custom up/down keys set via xmodmap (<Super-C>
etc.) got recognized everywhere in the OS except intellij; Can get configured in intellij keymap.
“View -> Appearance -> Tool window bars” gives extremely useful tool window bars that include a number, the one I can use in <Alt-N>
bindings to make them appear! Same goes for the …tabs to the right with Structure etc.
Once N maven goals or whatever are run and N tabs opened, they can be found again in the “Run” tool window bar (<Alt-4>
). Particular tabs can be also successfully restarted.
mvn [target] -Dcheckstyle.skip
does the magic without editing any POMs etc. 1
Nightcore - Wikipedia - A nightcore edit is a cover track that speeds up the pitch and time of its source material by 10–30%.
in trockenen Tüchern - “cut and dried” = “final”. See in trockenen Tüchern - Wiktionary
Nothing to add, but I think it works if you have access via public key instead of passwords. scp what-ever:/home/whatever/..<TAB>
works nicely with zsh even visualizing it like usual.
Also TODO rsync apparently can do the same things as scp, but better, I should give it a chance.
It’s possible use panda’s graphs as an ax and do all other modifications to it!
ax = data.plot(y=['tp','fn'], kind='bar',stacked='true')
You can drag and drop graphs directly from jupyter into a google docs presentation
uniq
can compare stuff before / after N characters in the string, group together duplicate ones, etc!
uniq -w N
looks at only the N first characters.uniq -s N
don’tt look at the first N charactersuniq --all-repeated[=METHOD]
prints all duplicated lines and optionally separates them via METHOD. separate
is really nice as method.uniq -c
prefixes line by number of occurrences of that lineAnd I guess again - uniq
works only on sorted data.
~strikethrough~, *bold*, _italic_
.> quoting
is as usual.in:#team-marketing
in:@sara
to:@anna
before:4/12/2019
after:4/12/2019
on:4/12/2019
during:april
has::white_check_mark:
has:pin
is:saved
has:link
Had to remove this snipped from vimrc:
augroup remember_folds
autocmd!
autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* loadview
augroup END
Will now try to use almost exclusively folding by tabs. For this, these are going to be helpful: 1
zo Open one fold under the cursor.
zc Close one fold under the cursor.
zO Open all folds under the cursor recursively.
zC Close all folds under the cursor recursively.
za When on a closed fold: open it.
When on an open fold: close it
zA When on a closed fold: open it recursively.
When on an open fold: close it recursively
zv View cursor line: Open just enough folds to make the line in
which the cursor is located not folded.
zX Undo manually opened and closed folds: re-apply 'foldlevel'.
Also forces recomputing folds, like |zx|.
zm Fold more: Subtract one from 'foldlevel'.
zM Close all folds: set 'foldlevel' to 0.
zr Reduce folding: Add one to 'foldlevel'.
zR Open all folds. This sets 'foldlevel' to highest fold level.
zn Fold none: reset 'foldenable'. All folds will be open.
zN Fold normal: set 'foldenable'. All folds will be as they
were before.
zi Invert 'foldenable'.
MOVING OVER FOLDS
[z Move to the start of the current open fold.
]z Move to the end of the current open fold.
zj Move downwards to the start of the next fold.
zk Move upwards to the end of the previous fold.
coding style - Where does the TODO convention come from? - Stack Overflow - XXX
as marker for something dangerous. Fixme Comment in c2 wiki for more.
Very ugly but it works:
fun! SetTodo()
syn match modo /.*MODO.*$/
hi link modo Keyword
syn match nodo /.*NODO.*$/
hi link nodo javaScript
syn match todo /\s*TODO.*$/
hi link todo vbTodo
syn match done /\s*DONE.*$/
hi link done cssListProp
syn match xxx /\s*XXX.*$/
hi link xxx htmlError
endfu
autocmd filetype markdown :call SetTodo()