Skip to content

Instantly share code, notes, and snippets.

View parthpower's full-sized avatar
:shipit:

Parth Parikh parthpower

:shipit:
View GitHub Profile
/*The circuit:
* LCD RS pin to digital pin 13
* LCD Enable pin to digital pin 12
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* LCD VSS pin to ground
* LCD VCC pin to 5V
@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 / VivadoCI.py
Last active June 10, 2016 13:41
A slightly modified version of https://github.com/Viq111/Vivado-CI I don't think it's "fork-able" so..Gist it is!
# -*- coding:Utf-8 -*-
# Vivado-CI Package
prog_name = "VivadoCI - Server Side"
# version:
version = 1
# By Viq - Vianney Tran
# License: Creative Commons Attribution-ShareAlike 3.0 (CC BY-SA 3.0)
# (http://creativecommons.org/licenses/by-sa/3.0/)
##############
from sys import argv
import numpy as np
import cv2
if len(argv)!=5:
print("Usage: %s <height> <width> <input TXT File> <output TXT File>"%(argv[0]))
exit()
from sys import argv
import cv2
import numpy as np
def genTxtFile(imageFilePath,txtFilepath):
inputImage = cv2.imread(imageFilePath)
grayInputImage = cv2.cvtColor(inputImage,cv2.COLOR_RGB2GRAY)
try:
txtFile = open(txtFilepath,"w")
@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 / !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.
@parthpower
parthpower / !URL Content Size.md
Last active February 18, 2016 12:57
URL Content Size

URL Content Size

Get the size of every URL content within a page. It uses CROS proxy https://cors-anywhere.herokuapp.com/ for making HEAD request to the destination URL. Similar to Search Result Size but this works on all pages.

Quick Start

  • Create a bookmark and set the content of bookmarklet as the URL. (Keep that bookmark in the bookmarkbar)
  • Go to any web page with links, and click that bookmark.

Known Issues

  • It doesn't work on all URLs.
  • The size of the web page may not be exact same because of dynamically loading XHRs.
@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