Skip to content

Instantly share code, notes, and snippets.

View wilspi's full-sized avatar
🎯
Focusing

Sourabh wilspi

🎯
Focusing
View GitHub Profile
@wilspi
wilspi / ScrapeBookmyshow.py
Created March 17, 2018 05:14
Screen Scraper based API for BookMyShow
#!/usr/bin/python
# Screen scraper based API for BookMyShow.
# Test Code for Bengaluru
import re
import urllib2
class BookMyShowClient(object):
NOW_SHOWING_REGEX = '{"event":"productClick","ecommerce":{"currencyCode":"INR","click":{"actionField":{"list":"Filter Impression:category\\\/now showing"},"products":\[{"name":"(.*?)","id":"(.*?)","category":"(.*?)","variant":"(.*?)","position":(.*?),"dimension13":"(.*?)"}\]}}}'
@wilspi
wilspi / Img2Text.py
Created March 17, 2018 04:47
Image to Text
from PIL import Image
from pytesseract import image_to_string
print image_to_string(Image.open('test.png'))
#print image_to_string(Image.open('test-english.jpg'), lang='eng')
@wilspi
wilspi / setup_react_native.md
Last active February 9, 2020 08:52
Setup for `React Native`

TODO

@wilspi
wilspi / gen_grpc_code.sh
Created January 22, 2018 12:43
Generates client and server GRPC python code for all protos, given protos' directory. Read more here: https://grpc.io/docs/tutorials/basic/python.html#generating-client-and-server-code
#!/bin/bash
# Proto files directory
PROTOS_PATH="src/protos/"
# Directory in which auto generated code will be saved
AUTOGEN_GRPC_PATH="src/autogen_grp/"
# Generate python grpc code for each proto
# Requires grpcio-tools: pip install grpcio-tools
for file in "$PROTOS_PATH"*
@wilspi
wilspi / gen_cert.sh
Created January 22, 2018 12:17
Generate self signed certificates
# Provide output directory path as argument
OUTPATH=$1
# Generate CA key:
openssl genrsa -des3 -out $OUTPATH/ca.key 4096
# Generate CA certificate:
openssl req -new -x509 -days 365 -key $OUTPATH/ca.key -out $OUTPATH/ca.crt
@wilspi
wilspi / mongo_dump_collections.sh
Last active January 24, 2018 09:54
Dumps given collections from source mongo db to destination mongo db
# Dumps given collections from source mongo db to destination mongo db
# Source DB Creds
source_host=""
source_port=""
source_user=""
source_password=""
source_db=""
# Destination DB Creds