Skip to content

Instantly share code, notes, and snippets.

View ansrivas's full-sized avatar

Ankur Srivastava ansrivas

View GitHub Profile
@ansrivas
ansrivas / .vimrc
Last active May 19, 2019 20:41
set vim-tab spaces to 4
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes
" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
#adding auto-complete to atom.
#install autocomplete-clang in atom and then install following
# perfect c/c++ autocomplete is ready
#my Keymap.json
#'atom-text-editor':
# 'ctrl-shift-q': 'editor:auto-indent'
#execute using sudo
@ansrivas
ansrivas / install_ggplot_rewrite.sh
Created September 10, 2015 23:19
this is to install the rewrite branch of ggplot2 python
apt-get install -y pkg-config
wait
apt-get install -y libfreetype6-dev libxft-dev
wait
pip install -I git+git://github.com/has2k1/ggplot.git@rewrite
@ansrivas
ansrivas / run.sh
Created September 16, 2015 22:02
run these so as to mount virtualbox-guestaddition.iso
apt-get update
apt-get install dkms build-essential linux-headers-$(uname -r)
mount /dev/cdrom /mnt
cd /mnt
./VBoxLinuxAdditions.run --nox11
@ansrivas
ansrivas / config
Last active November 24, 2017 16:06
my-terminator-configs
#vim ~/.config/terminator/config
#add following
[global_config]
enabled_plugins = LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
inactive_color_offset = 1.0
[keybindings]
copy = <Primary>c
cycle_next = <Shift>Tab
new_tab = <Primary><Shift>t
# Scala-IDE specific
.scala_dependencies
.worksheet
# IntelliJ specific
.idea
/bin/
*.class
*.log
@ansrivas
ansrivas / install_scipy_openblas.sh
Last active March 17, 2016 13:49
prerequisites for scipy installation
sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran libxml2-dev libxslt1-dev
sudo apt-get install python-numpy python-scipy python-dev python-pip python-nose g++ libopenblas-dev git
@ansrivas
ansrivas / create_jar_with_deps
Last active November 20, 2015 13:03
Use this to create jars with and without dependencies , mvn clean compile package
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<skipIfEmpty>true</skipIfEmpty>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
#use this to shuffle all the rows of pandas dataframe ( useful for some training algorithms )
import numpy as np
import pandas as pd
A = np.array([1, 2, 3])
B = np.array(['A', 'B', 'C'])
df = pd.DataFrame({'col1':A, 'col2':B})
print df.head()