learnbyexample

joined 1 year ago
 

Hello!

I am pleased to announce a new version of my CLI text processing with GNU Coreutils ebook. This ebook will help you learn 20+ specialized text processing commands provided by the coreutils package.

Cover image

This book heavily leans on examples to present features one by one. Exercises at the end of chapters will help you practice what you've learned and solutions are also provided for reference. External links are provided for further reading.

Links:

I would highly appreciate it if you'd let me know how you felt about this book. It could be anything from a simple thank you, pointing out a typo, mistakes in code snippets, which aspects of the book worked for you (or didn't!) and so on. Reader feedback is essential and especially so for self-published authors.

Happy learning :)

144
Vim prank: alias vim='vim -y' (learnbyexample.github.io)
 

Did you know that Vim has an Easy mode? It's the hardest mode for those already familiar with Vim ๐Ÿ™ƒ

[โ€“] [email protected] 1 points 8 months ago (3 children)

When I was younger, I'd read slowly, trying to visualize the setting, keep track of character preferences, look up words I don't know, etc. I'd remember a book well enough to talk about it even a year or so after.

These days, I just skim over descriptions and read as fast as I could while still getting the main plot. I get attached to characters only if the book is really good and savor them during rereads.

[โ€“] [email protected] 1 points 9 months ago (5 children)

I mostly read fantasy and sci-fi, which tend to have multiple books in a series. If they are easy-to-read and short (300-400 pages per book), it becomes easy to consume. Also, I read for escapism, so I don't read too closely.

[โ€“] [email protected] 4 points 9 months ago (7 children)

Hopefully less than this year. I'm reading too many (100+) and that's reflecting in my reduced time on actual work (self-employed).

[โ€“] [email protected] 6 points 9 months ago (1 children)

I have a list of curated resources here: https://learnbyexample.github.io/py_resources/

There are sections for beginners, intermediate, advanced, etc. Also included are exercises, projects, debugging, testing, and many more stuff. Hope it helps :)

[โ€“] [email protected] 3 points 9 months ago

See also: https://jimbly.github.io/regex-crossword/

For Python, I wrote a TUI app with 100+ interactive exercises: https://github.com/learnbyexample/TUI-apps/blob/main/PyRegexExercises (covers both re and regex modules)

[โ€“] [email protected] 11 points 10 months ago (2 children)

+1 for Cradle already mentioned. I'd add

  • The Riyria Revelations by Michael J. Sullivan
  • Kings of the Wyld by Nicholas Eames
[โ€“] [email protected] 4 points 10 months ago

It's the name of the constructor, for example:

const pat1 = new RegExp(`42//?5`)

So, I used that in the book name.

[โ€“] [email protected] 2 points 11 months ago

That's great to hear and thanks for the kind feedback :)

[โ€“] [email protected] 8 points 11 months ago (1 children)
[โ€“] [email protected] 1 points 11 months ago

I used to use it for posting on Twitter, with some keywords (like book title) in bold.

[โ€“] [email protected] 7 points 11 months ago* (last edited 11 months ago) (2 children)
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$//' "$@" ; }
view more: โ€น prev next โ€บ