작은 팁 모음
- gist 설명 부분에 내용을 적어야 빠른 검색이 된다.
작은 팁 모음
| # how-can-i-delete-a-newline-if-it-is-the-last-character-in-a-file | |
| # http://stackoverflow.com/a/1654042 | |
| perl -pe 'chomp if eof' filename > filename2 | |
| # edit in place | |
| perl -i -pe 'chomp if eof' filename |
| # random password generator | |
| import random | |
| import string | |
| chars = string.ascii_letters + string.digits | |
| chars += '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' | |
| size = 12 | |
| ''.join(random.SystemRandom().choice(chars) for x in range(size)) |
| pygmentize -f rtf -O style=default,fontface="Consolas" -l c -o hello.rtf hello.c |