This file contains hidden or 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
| ## 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[@]}" | |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| from flask import Flask | |
| from flask_restful import Api, Resource, reqparse | |
| app = Flask(__name__) | |
| api = Api(app) | |
| users = [ | |
| { | |
| "name": "Nicholas", | |
| "age": 42, |