Skip to content

Instantly share code, notes, and snippets.

Avatar

Ashwin V. Mohanan ashwinvis

View GitHub Profile
@ashwinvis
ashwinvis / tmux_local_install.sh
Last active Sep 2, 2016
Tmux local installation without root
View tmux_local_install.sh
#!/bin/bash
#
# Add the following lines to .bashrc before running the script
#
# export SCRATCH=/scratch/$USER
# export XDG_DATA_DIRS=$XDG_DATA_DIRS:$SCRATCH/.local/share
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SCRATCH/.local/lib
# export PATH=$PATH:$SCRATCH/.local/bin
set -e
@ashwinvis
ashwinvis / install_fftw.sh
Created Jun 15, 2017
FFTW local installation
View install_fftw.sh
#!/bin/bash
pkgname='fftw'
pkgver=3.3.6-pl2
srcdir=$PWD
pkgdir='$HOME/.local/share/fftw'
download() {
cd ${srcdir}
@ashwinvis
ashwinvis / .conda_aliases
Created Oct 14, 2017
Use Anaconda's `conda` tool as if you were using `virtualenvwrapper`
View .conda_aliases
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
}
@ashwinvis
ashwinvis / guake_local_install_debian_wheezy.sh
Created Mar 17, 2016
Guake local installation without root
View guake_local_install_debian_wheezy.sh
#!/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
View terminal_read.py
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')
View terminal_hide_cursor.py
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)
View FluidSim interactive output.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ashwinvis
ashwinvis / Interpolation.ipynb
Last active Aug 10, 2018
Unstructured 2D data algorithms in scipy.interpolate: results and performance
View Interpolation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ashwinvis
ashwinvis / math.md
Created Apr 16, 2019
Markdown + latex
View math.md

Markdown stuff

import this

Inline equations

$\Sigma_{i=0}^\infty \frac{1}{n} = 2$ is a fact. However:

View unstar_github.py
# 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