Skip to content

Instantly share code, notes, and snippets.

Dhruv Kar dhruvkar

Block or report user

Report or block dhruvkar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am dhruvkar on github.
  • I am dhruvkar (https://keybase.io/dhruvkar) on keybase.
  • I have a public key whose fingerprint is 4567 DD8B 3255 4C43 0B2F 6A0F 4FDC 3E91 57A4 50A2

To claim this, I am signing this object:

@dhruvkar
dhruvkar / browser.py
Last active Mar 22, 2019
Run Browser in a Virtual Display using Selenium and transfer session to Python Requests
View browser.py
"""
If you use Chrome, get Chromedriver and put in your PATH:
http://chromedriver.chromium.org/downloads
If you use Firefox, get Geckodriver and put in your PATH:
https://github.com/mozilla/geckodriver/releases
Also install:
pip install requests
@dhruvkar
dhruvkar / biz_ratings.py
Last active Mar 22, 2019
Get Yelp and Google ratings of a business, given the business name, address, & phone number.
View biz_ratings.py
#!/usr/bin/env python
from __future__ import print_function
import json
import re
import requests # pip install requests
from yelpapi import YelpAPI # pip install yelpapi. Not a very mature library, use at your own risk.
from requests.compat import urljoin, quote_plus
@dhruvkar
dhruvkar / mkdir.py
Last active Aug 23, 2017
best way to make a directory in python
View mkdir.py
def mkdir(dir_path)
try:
os.makedirs(dir_path)
except OSError as e:
if e.errno != errno.EEXIST:
raise
@dhruvkar
dhruvkar / config.js
Last active Dec 20, 2017
Config file for Ghost
View config.js
// # Ghost Configuration
// Setup your Ghost install for various environments
var path = require('path'),
config;
config = {
// ### Development **(default)**
development: {
// The url to use when providing links to the site, E.g. in RSS and email.
You can’t perform that action at this time.