How to enable source highlighting when doing `less mycodefile.ext`

How to enable source highlighting when doing less mycodefile.ext Install source-highlight sudo apt install source-highlight Configure it on your .bash_profile lessWithSourceHighlightSetup() { # location of the script may vary src_hilite_pipe_script=`dpkg -L libsource-highlight-common | grep lesspipe` export LESSOPEN=”| ${src_hilite_pipe_script} %s” export LESS=’ -R ‘ } lessWithSourceHighlightSetup Use it on any code file less -N /path/to/mycode.ext view […]

Pascal Triangle Generator in Python, and then in Haskell – The Gubatron Method

Here’s in python, imperatively, and then in functional style without the need for loops. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters def pascal(n): […]