Remove trailing whitespace from files
sed -i 's/[ \t]*$//' folder/*/*.py
Convert Jupyter notebook to PPT
jupyter nbconvert --to slides filename.ipynb
from crontab import CronTab | |
from datetime import datetime | |
cron = CronTab() | |
cmds = { | |
'python ~/code/reminder.py': '0/30 9-18 * * *', | |
'~/code/backup.sh': '0/30 9-18 * * *', | |
} | |
for cmd, cron_str in cmds.items(): |
sed -i 's/[ \t]*$//' folder/*/*.py
jupyter nbconvert --to slides filename.ipynb
from pyinstrument import Profiler
profiler = Profiler()
profiler.start()
# --- code to profile : start ---
# e.g. :-
" -------------------------------------------------- | |
" Vundle package manager settings | |
" -------------------------------------------------- | |
set nocompatible | |
filetype off | |
" ---------- Set path of vundle file ---------- | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' |
gitconfig
file :[alias]
graph1 = log --graph --abbrev-commit --decorate --format=format:'%C(blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(bold white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
graph2 = log --graph --abbrev-commit --decorate --format=format:'%C(blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n''%C(bold white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
git graph1
or git graph2
in your project folder to view a nice git logsudo apt-get install xkbset
xkbset ma 60 10 10 5 2
## Add sudo wherever needed | |
## list all files in current directory | |
alias ll="ls -alh" | |
## apt shorthands | |
alias sau="sudo apt-get update" | |
alias sai="sudo apt-get install" | |
sar() { | |
sudo apt-get autoremove |