Skip to content

Instantly share code, notes, and snippets.

View Khalian's full-sized avatar

Arunav Sanyal Khalian

  • Vancouver, BC, Canada
View GitHub Profile
@Khalian
Khalian / remcharafter
Created August 6, 2017 07:51
Remove all characters after a given character.
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Usage: remcharafter character"
exit 1
fi
cut -f1 -d"$1"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#!/bin/sh
ln -s ~/.vim ~/.config/nvim
ln -s ~/.vimrc ~/.config/nvim/init.vim
# Mac specific stuff
alias rmDerivedData="rm -rf ~/Library/Developer/Xcode/DerivedData"
alias cdDerivedData="cd ~/Library/Developer/Xcode/DerivedData"
# FZF specific stuff
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export FZF_DEFAULT_OPTS='--height 40% --reverse --border'
alias tb="nc termbin.com 9999"
# Git specific stuff
@Khalian
Khalian / install_neovim_to_amazonlinux.sh
Created September 11, 2017 07:24 — forked from kawaz/install_neovim_to_amazonlinux.sh
install neovim to amazonlinux
#!/usr/bin/env bash
sudo yum groups install -y Development\ tools
sudo yum install -y cmake
sudo yum install -y python34-{devel,pip}
sudo pip-3.4 install neovim --upgrade
(
cd "$(mktemp -d)"
git clone https://github.com/neovim/neovim.git
cd neovim
make CMAKE_BUILD_TYPE=Release
tnoremap <Esc> <C-\><C-n>
tnoremap jj <C-\><C-n>
au TermOpen * set number
sudo find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -n
@Khalian
Khalian / install.sh
Created August 8, 2018 00:19
Arunav's pimped up installation of rad stuff
# This is to be used in environments without proper yum usage.
# Mosh
sudo yum -y install autoconf automake gcc gcc-c++ make boost-devel
sudo yum -y install zlib-devel ncurses-devel protobuf-devel openssl-devel
wget https://mosh.org/mosh-1.3.0.tar.gz
tar xf mosh-1.3.0.tar.gz -C /tmp/
cd /tmp/mosh-1.3.0
./configure
make -j7
sealed trait Addable[T] {
def add(a: T, b: T): T
}
object AddableInstances {
implicit val intAddable = new Addable[Int] {
override def add(a: Int, b: Int): Int = a + b
}
}
@Khalian
Khalian / simpleWebServer
Last active January 4, 2019 19:16
Simple command line webserver
Simple server init : python -m SimpleHTTPServer 8000
Simple get request : echo -e "GET / HTTP/1.1" | nc localhost 8000