learnbyexample

joined 1 year ago
69
How To Make Good Small Games (farawaytimes.blogspot.com)
submitted 7 months ago by learnbyexample to c/programming
 

Let me know your feedback, especially if you haven't learned awk yet!

 

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 :)

148
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 ๐Ÿ™ƒ

[โ€“] learnbyexample 1 points 1 year ago

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

[โ€“] learnbyexample 7 points 1 year ago* (last edited 1 year 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$//' "$@" ; }
[โ€“] learnbyexample 2 points 1 year ago

I recently wrote a few interactive TUI apps to help practice grep, sed, awk and other CLI tools: https://github.com/learnbyexample/TUI-apps

[โ€“] learnbyexample 7 points 1 year ago (2 children)

EPUB reader

[โ€“] learnbyexample 6 points 1 year ago* (last edited 1 year ago) (1 children)

Check out https://github.com/auctors/free-lunch (list of free Windows software)

See also https://www.nirsoft.net/ (freeware, not open source)

[โ€“] learnbyexample 2 points 1 year ago

Cradle by Will Wight is a page-turner. 12 book completed series and audio is great based on gushing reviews I've come across.

[โ€“] learnbyexample 4 points 1 year ago

GVim.

Check out https://ghostwriter.kde.org/ if you are looking for a GUI app with live preview, full screen mode, etc.

[โ€“] learnbyexample 2 points 1 year ago

If he likes games, check out "Invent Your Own Computer Games with Python": https://inventwithpython.com/invent4thed/

[โ€“] learnbyexample 5 points 1 year ago (2 children)

If you are looking for books, check out:

Intermediate:

  • Beyond the Basic Stuff with Python โ€” Best Practices, Tools, and Techniques, OOP, Practice Projects
  • Pydon'ts โ€” Write elegant Python code, make the best use of the core Python features
  • Python Distilled โ€” this pragmatic guide provides a concise narrative related to fundamental programming topics such as data abstraction, control flow, program structure, functions, objects, and modules

Advanced:

  • Fluent Python โ€” takes you through Pythonโ€™s core language features and libraries, and shows you how to make your code shorter, faster, and more readable at the same time
  • Serious Python โ€” deployment, scalability, testing, and more
  • Practices of the Python Pro โ€” learn to design professional-level, clean, easily maintainable software at scale, includes examples for software development best practices
  • Intuitive Python โ€” productive development for projects that last
[โ€“] learnbyexample 5 points 1 year ago

I have a book for Perl One-Liners as well, which I'm currently revising :)

[โ€“] learnbyexample 5 points 1 year ago

I've written books on regex too, if you are interested in learning ;)

view more: โ€น prev next โ€บ