import this
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
## General stuff | |
## Uncomment if pip cache takes up too much space | |
# alias pip="python -m pip --no-cache-dir" | |
## or even better simply symlink ~/.cache/pip | |
alias spyder='env python /usr/bin/spyder' | |
alias spyder3='env python3 /usr/bin/spyder3' | |
alias jupyter-clean-checkpoints='find -name ".ipynb_checkpoints" -type d | xargs rm -rf' | |
alias ipcluster-mpi='ipcluster start -n 2 --engines=MPIEngineSetLauncher' |
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
# coding: utf-8 | |
""" | |
Ref | |
--- | |
* https://pygithub.readthedocs.io/en/latest/introduction.html#very-short-tutorial | |
If you are using an access token to circumvent 2FA, make sure you have | |
enabled "repo" scope | |
Troubleshooting |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import curses | |
import time | |
stdscr = curses.initscr() | |
curses.curs_set(1) # visible | |
time.sleep(2) | |
curses.curs_set(0) # invisible | |
time.sleep(2) | |
curses.curs_set(1) # visible | |
time.sleep(2) |
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
import curses | |
from random import randint | |
# Print random text in a 10x10 grid | |
stdscr = curses.initscr() | |
for rows in range(10): | |
line = ''.join([chr(randint(41, 90)) for i in range(10)]) | |
stdscr.addstr(line + '\n') |
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
#!/bin/bash | |
# Locally install guake without root privileges | |
# Tested on a Debian 7 Wheezy machine with Guake v0.4.3-3 | |
# | |
# (c) 2016 Ashwin Vishnu | |
LOCALUSR=$HOME/.local | |
mkdir -p $LOCALUSR |
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
alias workon='source activate' | |
alias deactivate='source deactivate' | |
alias mkvirtualenv='conda create' | |
alias lsvirtualenv='conda-env list' | |
alias rmvirtualenv='conda-env remove' | |
function cpvirtualenv{ | |
conda create --clone $1 --name $2 | |
} |
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
#!/bin/bash | |
pkgname='fftw' | |
pkgver=3.3.6-pl2 | |
srcdir=$PWD | |
pkgdir='$HOME/.local/share/fftw' | |
download() { | |
cd ${srcdir} |