Skip to content

Instantly share code, notes, and snippets.

View Nitish18's full-sized avatar

Nitish Chauhan Nitish18

View GitHub Profile
@Nitish18
Nitish18 / gist:3e2ee11b8667470ff75b658b636e06b2
Created February 16, 2017 08:13
Yaml file for dashboard
swagger: "2.0"
info:
description:
API documentation for DASHBOARD module
version: "1.0.0"
title: DASHBOARD module
contact:
name: innovaccer
license:
name: Apache 2.0
swagger: "2.0"
info:
description:
API documentation for DASHBOARD module
version: "1.0.0"
title: DASHBOARD module
contact:
name: innovaccer
host: innovaccer.com
@Nitish18
Nitish18 / Python_elasticsearch_scrollAPI
Created September 23, 2017 19:04
Python script to test scroll api of elasticsearch
from elasticsearch import Elasticsearch as ES
import json
# Elastic Setup config
host = "localhost"
port = 9200
index = "your_index"
doc_type = "your_doc_type"
es = ES(host=host, port=port, timeout=100)
@Nitish18
Nitish18 / MongoSchema
Created December 2, 2017 23:42
MongoSchema
{
"_id" : ObjectId("5a231602e9e14e28f6c1aef6"),
"diseaseType" : "WaterBorne",
"foodFiberContent" : 1,
"bacteriaTypeInAir" : 14,
"phLevel" : 6.80568506270618,
"year" : 2015,
"ppmLevel" : 0.0613222520500754,
"city" : "Dioli",
"name" : "Dr. Ashley Diaz",
{
"name" : "nitish",
"age" : "23",
"DOB" : "18.12.12",
"sex": "male",
"city" : "delhi"
},
{
"name" : "shubham",
"age" : "23",
@Nitish18
Nitish18 / gist:c06b45a836d0d88b1abb56f512da7126
Created March 3, 2018 13:32
Sample lambda function file for Alexa skill
import urllib2
import json
import requests
def lambda_handler(event, context):
if (event["session"]["application"]["applicationId"] !=
"your_skill_id"):
raise ValueError("Invalid Application ID")
if event["session"]["new"]:
@Nitish18
Nitish18 / flatten_json.py
Created August 16, 2018 04:59
simple python function to flatten your json
import json
def main():
demo_obj = {
'a' : 1,
'b' : {
'c' : 'd',
'e' : {
'x' : 'y'
}
@Nitish18
Nitish18 / gist:99e8ede243777820e190b4810d391a9f
Created November 21, 2018 18:03
food item supported by alexa skill - My calorie count
"Tosai","Shev Dahi Batata Puri"
"Curry"
"Shimla Mirch Aloo"
"Nasi Bryani (Rice Only) Singapore"
"Vadi"
"Brown Rice With Lentils and Vegetables"
"Chicken Masala W/ Naan Wrap"
"Aloo Baigan Cooked Vegitable"
"Dosai"
"Vegetable Jhalfrezi"
import requests
import json
import os
from bs4 import BeautifulSoup
def main():
'''
'''
base_url = "http://hck.re/crowdstrike"
import requests
import json
import os
import traceback
from bs4 import BeautifulSoup
def main():
'''
'''