Skip to content

Instantly share code, notes, and snippets.

View bhardwajRahul's full-sized avatar
🎯
Focusing

Rahul Bhardwaj bhardwajRahul

🎯
Focusing
View GitHub Profile
@bhardwajRahul
bhardwajRahul / dummy-web-server.py
Created October 24, 2017 05:32 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@bhardwajRahul
bhardwajRahul / ledctrl.py
Created November 13, 2017 19:31 — forked from electronut/ledctrl.py
A simple example for communicating with a Raspberry Pi from you phone's browser. Uses the Bottle Python web framework, and jQuery AJAX.
"""
ledctrl.py
A simple example for communicating with a Raspberry Pi from you phone's
browser. Uses the Bottle Python web framework, and jQuery AJAX.
Author: Mahesh Venkitachalam / electronut.in
"""
@bhardwajRahul
bhardwajRahul / ipcam.py
Created November 16, 2017 04:13 — forked from shihyuan/ipcam.py
Stream Video with OpenCV in Python from an Android running IP Webcam
# Stream Video with OpenCV from an Android running IP Webcam (https://play.google.com/store/apps/details?id=com.pas.webcam)
# Code Adopted from http://stackoverflow.com/questions/21702477/how-to-parse-mjpeg-http-stream-from-ip-camera
import cv2
import urllib2
import numpy as np
import sys
host = "192.168.0.220:8080"
if len(sys.argv)>1:
@bhardwajRahul
bhardwajRahul / Instructions.md
Created February 28, 2018 09:51 — forked from glocore/Instructions.md
Setup React Native on Ubuntu 16.04/16.10

1. Install Node.js

  • Follow the steps given here to install Node.js and NPM.
  • Verify whether NPM is installed by typing npm -v in a terminal window.

2. Install React Native CLI

  • npm install -g react-native-cli

3. Setup Android Development Environment

  • Download and install Android Studio as explained here.
  • Run Android Studio and open the SDK Manager. Under the SDK Platforms tab, check Show Package Details, expand Android 6.0 (Marshmallow) and check the following:
@bhardwajRahul
bhardwajRahul / request.php
Created January 19, 2019 15:49
API wrapper
<?php
namespace App\DistanceApi\Api;
/*
|--------------------------------------------------------------------------
| Request Class
|--------------------------------------------------------------------------
|
| This class is used when querying your API.
@bhardwajRahul
bhardwajRahul / TechChallengeReview_52_20190208.md
Created February 20, 2019 11:24 — forked from blademirage/TechChallengeReview_52_20190208.md
Tech Challenge Review 52 (2019-02-08)

Considered this submission as a PASS case.

Submitted tech challenge:

Pros:

  • API endpoints naming follows problem statement.
  • Clean and tidy code.
  • Demonstrated well use of existing frameworks/libraries.
@bhardwajRahul
bhardwajRahul / stock.py
Created April 14, 2019 03:35 — forked from sanand0/stock.py
Pull currency and stock data
#! /usr/bin/env python
"""
Author: Bastin Robin
"""
import os
import logging
from urllib import urlencode
import datetime
import pandas as pd
@bhardwajRahul
bhardwajRahul / webdev_online_resources.md
Created May 12, 2019 05:16 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@bhardwajRahul
bhardwajRahul / MultiThreadedSensorServer.py
Created July 24, 2019 20:40
UDP based Multi Threaded Sensor Server to receive data from IOT, Smartphone and other devices.
import socket
import threading
import time
class ThreadedServer(object):
def __init__(self, host, port):
self.host = host
self.port = port
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
@bhardwajRahul
bhardwajRahul / profile.py
Created November 28, 2019 18:50 — forked from Shuhala/profile.py
Profile a code block
import cProfile
import contextlib
import io
import pstats
@contextlib.contextmanager
def profile(max_results=-1, pattern="*"):
"""
Profile a code block