This file contains hidden or 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
| filter(lambda x: x < 5, range(10)) | |
| vs. | |
| def foo(x): | |
| return x < 5 | |
| bar = range(10) | |
| filter(foo, bar) |
This file contains hidden or 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
| # Turn the visual bell off | |
| vbell off | |
| # Set up a status line at the bottom of the screen | |
| hardstatus alwayslastline | |
| hardstatus string '%{= kG}[ %{B}%H %{g}][ %{w}%{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g} ][ %{B}%Y-%m-%d %{W}%c %{g}]' | |
| # 10k lines of scrollback | |
| defscrollback 10000 |
This file contains hidden or 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
| function newns { | |
| if [ $# -ne 1 ]; then | |
| echo "Incorrect number of arguments: $# Expected: 1" | |
| return 1 | |
| elif [ ! -e project.clj ]; then | |
| echo "Not in a project directory." | |
| return 1 | |
| fi | |
| local filename=src/$(echo $1 | tr .- /_).clj | |
| local testname=test/$(echo $1 | tr .- /_)_test.clj |
This file contains hidden or 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
| #!/bin/bash | |
| logfile="/var/log/tarsnap.log" | |
| email="[email protected]" | |
| stuff_to_back_up="/home/ /etc/ /var/www/" | |
| exclude_pattern="Dropbox" | |
| ( /bin/echo "$(/bin/date +"%T %F") Starting backup" | |
| /usr/local/bin/tarsnap -c --configfile /usr/local/etc/tarsnap.conf --exclude $exclude_pattern -f "$HOSTNAME-$(/bin/date +%F)" $stuff_to_back_up 2>&1 | |
| /bin/echo "$(/bin/date +"%T %F") Backup finished" | |
| ) | /usr/bin/tee -a $logfile | /usr/bin/mailx -s "$HOSTNAME backup results" $email | |
| /bin/echo "=================================" >> /var/log/tarsnap.log |
NewerOlder