Skip to content

Instantly share code, notes, and snippets.

View parthpower's full-sized avatar
:shipit:

Parth Parikh parthpower

:shipit:
View GitHub Profile
@parthpower
parthpower / A.py
Last active March 9, 2016 20:29
TCS CodeVita Solutions I don't remember problem statements:p
#Copyright (c) 2016 Parth V. Parikh
#Freely distributable under MIT lincese.
__author__ = 'Parth'
def alternate(num, target):
if int(num)<3:
return False
found = False
occ = []
@parthpower
parthpower / RPiGPIOServer.py
Last active February 18, 2016 13:03
Simple Raspberry Pi HTTP GPIO Control
__author__ = 'Parth'
import BaseHTTPServer
import urlparse
import RPi.GPIO as GPIO
PORT = 8000
class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
args = {}
@parthpower
parthpower / imgtocoe.py
Last active April 4, 2017 20:59
Simple gray scale image data to COE file convertor for Xilinx Block Memory initialization
__author__ = 'Parth Parikh'
import sys
import cv2
def help1():
print "Usage: imgtocoe <image path> <output name>"
exit()
if len(sys.argv) <3:
#author: Parth Parikh
#Distributed under MIT License
#Simple Serial CSV Logger
import serial
import datetime
LOG_FILE = datetime.datetime.now().strftime('%d_%m_%Y_%H_%M_%S')+"_log.csv"
BAUD = 9600
def available_ports():
#Author: Parth Parikh
#Distributed under MIT license
import serial
import pynmea2
import datetime
from dateutil import tz
LOG_FILE = datetime.datetime.now().strftime('%d_%m_%Y_%H_%M_%S')+"_gps_log.csv"
LOG_FILE_RAWPACKET = datetime.datetime.now().strftime('%d_%m_%Y_%H_%M_%S')+"_gps_raw_log.txt"
@parthpower
parthpower / find_by_identifier.py
Last active December 20, 2015 23:44
Function to get string between start identifier and end identifier string.
#Released under MIT license.
__author__ = 'Parth Parikh'
__license__ = 'MIT'
def find_by_identifier(data,startIdentifier,endIdentifier):
result = []
identLen = len(startIdentifier)
##First check
##print(identLen)
startIdentIndex = -1
@parthpower
parthpower / DefinationFromGoogle.py
Last active April 3, 2017 17:54
Grabs Definition section from Google search result!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! It works actually!
import requests
import BeautifulSoup
from sys import argv
word = "tied"
if __name__ == "__main__":
if len(argv)>2:
word = argv[1]
data = requests.get("https://www.google.com/search?q=definition+%s"%word)
@parthpower
parthpower / !WhatsApp On Web Monitor.md
Last active August 10, 2024 13:42
Simple JS to monitor offline and online time of a contact.

WhatsApp On Web Monitor

What It does

It gives notifications when someone goes online or offline or typing. Open chat of the contact you want to monitor and start script.

Simple Way

@parthpower
parthpower / !WhatsApp Emoji Bomber.md
Last active October 28, 2024 17:30
WhatsApp Emoji Bomber
@parthpower
parthpower / !Search Result Size.md
Last active February 18, 2016 12:59
Search Result Size

Search Result Size

Stable Optimized version of URL Content Size for Google Search Results.

What is this?

Get the size of each Google search result before visiting the site. It uses CROS proxy https://cors-anywhere.herokuapp.com/ for making HEAD request to the destination URL.

Quick Start

  • Create a bookmark and set the content of bookmarklet as the URL. (Keep that bookmark in the bookmarkbar)
  • On search result page of Google, click on that bookmark and see the magic.

Known Issues

  • It doesn't work on all URLs due to Refused to get unsafe header "content-length" exception.