Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Shrey Batra shreybatra

🏠
Working from home
View GitHub Profile
View machine.js
const parallelApis = Machine({
id: "Parallel-apis",
type: "parallel",
states: {
userInfo: {
initial: "apiCall",
states: {
apiCall: {
on: {
RESPONSE: "buildUserMap"
View machine.js
const patientSelectionMachine = Machine({
id: "patientSelector",
initial: "pickPatients",
states: {
pickPatients: {
on: {
FROM_MEASURE: "measure",
FROM_ADT: "activity",
FROM_CSV: "customCsv"
}
View tokenization_stopwords.py
import nltk
from nltk.corpus import stopwords
text = "Hi, Laptops from Hewlett-Packard aren't running MacOS. We would love an Apple Mac for our work."
print('Word tokenization - ')
word_token = nltk.word_tokenize(text)
print(word_token)
@shreybatra
shreybatra / blog.py
Last active Feb 20, 2019
A sample Flask API to showcase usage of MongoDB in Python
View blog.py
from flask import Flask, request,jsonify
from pymongo import MongoClient
from bson.objectid import ObjectId
from datetime import datetime
app = Flask(__name__)
client = MongoClient()
db = client.blogdb
blogs = db.blogs
@shreybatra
shreybatra / snakecoin-server-full-code.py
Created Nov 11, 2018 — forked from aunyks/snakecoin-server-full-code.py
The code in this gist isn't as succinct as I'd like it to be. Please bare with me and ask plenty of questions that you may have about it.
View snakecoin-server-full-code.py
from flask import Flask
from flask import request
import json
import requests
import hashlib as hasher
import datetime as date
node = Flask(__name__)
# Define what a Snakecoin block is
class Block:
@shreybatra
shreybatra / car.py
Last active Mar 19, 2018
MongoDB connection in Flask
View car.py
'''
This code is a sample code written to explain MongoDB and how to integrate it in Flask.
For full blog visit - http://www.eazydevelop.com/2018/03/mongodb-and-integration-with-flask.html
'''
from flask import Flask, request, jsonify
from pymongo import MongoClient
import pymongo
You can’t perform that action at this time.