Skip to content

Instantly share code, notes, and snippets.

View adithya-sn's full-sized avatar

Adithya adithya-sn

  • Bengaluru, India
View GitHub Profile
@adithya-sn
adithya-sn / bash_snippets.sh
Last active March 8, 2021 13:48
BASH snippets
## Remove common elements bw two arrays
array1="111 222 333 444 555 666 777 888 999"
array2="222 444"
for host in ${array2[@]}; do
array1=( "${array1[@]/$host}" )
done
echo "The new list of elements in array1 are: ${array1[@]}"
@adithya-sn
adithya-sn / .vimrc
Created October 10, 2019 04:54
my vimrc
syntax on
filetype plugin indent on
au BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml foldmethod=indent
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
set nocompatible
set backspace=indent,eol,start
au BufNewFile,BufReadPost *py set filetype=python foldmethod=indent
autocmd FileType python setlocal ts=4 sts=4 sw=4 tw=79 ff=unix
from flask import Flask
from flask_restful import Api, Resource, reqparse
app = Flask(__name__)
api = Api(app)
users = [
{
"name": "Nicholas",
"age": 42,