Interests: Regular Expressions, Linux CLI one-liners, Scripting Languages and Vim
I wish you success. I’m happy to use SimpleScreenRecorder(https://github.com/MaartenBaert/ssr).
Is it regex or sed/awk syntax (or both) that gives you trouble?
I had similar reaction and didn’t even try to learn them for years - then I caught the stackoverflow craze of answering CLI questions (and learning from others).
oxipng, pngquant and svgcleaner for optimizing images
auto-editor for removing silent portions from video recordings
Not my blog, just sharing it here. Saw it on HN (https://news.ycombinator.com/item?id=40419325)
What’s the difference between two_percent and skim?
Yeah, it is uncommon spelling, but if you google, you’ll find it’s not that rare ;)
You’re welcome, happy learning :)
I’m self-published and haven’t worked for other publications. Sometimes, my submissions reach HN front page, so you might have seen there or because others picked it up from there and shared around elsewhere.
As per the manual, “Mappings are set up to work like most click-and-type editors” - which is best suited with GUI Vim.
While Vim doesn’t make sense to use without the modes, there are plugins like https://github.com/tombh/novim-mode!
That’s great to hear and thanks for the kind feedback :)
I used to use it for posting on Twitter, with some keywords (like book title) in bold.
alias a='alias'
a c='clear'
a p='pwd'
a e='exit'
a q='exit'
a h='history | tail -n20'
# turn off history, use 'set -o history' to turn it on again
a so='set +o history'
a b1='cd ../'
a b2='cd ../../'
a b3='cd ../../../'
a b4='cd ../../../../'
a b5='cd ../../../../../'
a ls='ls --color=auto'
a l='ls -ltrhG'
a la='l -A'
a vi='gvim'
a grep='grep --color=auto'
# open and source aliases
a oa='vi ~/.bash_aliases'
a sa='source ~/.bash_aliases'
# sort file/directory sizes in current directory in human readable format
a s='du -sh -- * | sort -h'
# save last command from history to a file
# tip, add a comment to end of command before saving, ex: ls --color=auto # colored ls output
a sl='fc -ln -1 | sed "s/^\s*//" >> ~/.saved_commands.txt'
# short-cut to grep that file
a slg='< ~/.saved_commands.txt grep'
# change ascii alphabets to unicode bold characters
a ascii2bold="perl -Mopen=locale -Mutf8 -pe 'tr/a-zA-Z/𝗮-𝘇𝗔-𝗭/'"
### functions
# 'command help' for command name and single option - ex: ch ls -A
# see https://github.com/learnbyexample/command_help for a better script version
ch() { whatis $1; man $1 | sed -n "/^\s*$2/,/^$/p" ; }
# add path to filename(s)
# usage: ap file1 file2 etc
ap() { for f in "$@"; do echo "$PWD/$f"; done; }
# simple case-insensitive file search based on name
# usage: fs name
# remove '-type f' if you want to match directories as well
fs() { find -type f -iname '*'"$1"'*' ; }
# open files with default application, don't print output/error messages
# useful for opening docs, pdfs, images, etc from command line
o() { xdg-open "$@" &> /dev/null ; }
# if unix2dos and dos2unix commands aren't available by default
unix2dos() { sed -i 's/$/\r/' "$@" ; }
dos2unix() { sed -i 's/\r$//' "$@" ; }
See also:
Inspired by explainshell, I wrote a script (https://github.com/learnbyexample/command_help) to be used from the terminal itself. It is a bit buggy, but works well most of the time. For example:
$ ch grep -Ao
grep - print lines that match patterns
-A NUM, --after-context=NUM
Print NUM lines of trailing context after matching lines. Places a
line containing a group separator (--) between contiguous groups of
matches. With the -o or --only-matching option, this has no effect
and a warning is given.
-o, --only-matching
Print only the matched (non-empty) parts of a matching line, with
each such part on a separate output line.
I use GVim for coding and text editing in general.
Programming wise, CLI tools (grep, sed, awk, sort, head, etc) are enough for most of my tasks. I’ve written a few Python TUI projects (uses Textual framework) but these are around 300-400 lines, so Vim is more than enough for my purposes. Don’t even need any plugins.
https://github.com/WyattBlue/auto-editor - automatically editing video and audio by analyzing a variety of methods, most notably audio loudness
https://github.com/shssoichiro/oxipng, https://pngquant.org/ and https://github.com/RazrFalcon/svgcleaner for optimizing images
Here are some resources that might help:
For scripting, keep these links handy:
Also, +1 for Linux Journey mentioned in another comment.
Can’t reproduce your issue:
$ line='2023-06-19T00:00:00+01:00 2023-06-18T00:00:00+01:00 2023-06-17T00:00:00+01:00 2023-06-16T00:00:00+01:00 2023-06-15T00:00:00+01:00 2023-06-14T00:00:00+01:00 2023-06-13T00:00:00+01:00 2023-06-10T00:00:00+01:00 2023-06-03T00:00:00+01:00 2023-05-31T00:00:00+01:00 2023-05-27T00:00:00+01:00'
$ arr=( $line )
$ echo "${arr[4]}"
2023-06-15T00:00:00+01:00
I have a concise guide at https://learnbyexample.github.io/cli-computing/searching-files-and-filenames.html#grep and a more detailed book at https://learnbyexample.github.io/learn_gnugrep_ripgrep/introduction.html. Both have examples and exercises.
I use Vim ;)
Python itself provides IDLE, which is good enough for beginners. https://thonny.org/ is another good one for beginners.
As mentioned by others, Jetbrains is good for many languages. https://www.kdevelop.org/ is another option.