Skip to content

Instantly share code, notes, and snippets.

📢
Working from home

Adnan Siddiqi kadnan

📢
Working from home
Block or report user

Report or block kadnan

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 Ecommerce - EDA.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Ecommerce - EDA.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kadnan
kadnan / docker-compose.yaml
Last active May 15, 2019
Docker compose file for running Cassandra Cluster
View docker-compose.yaml
version: '2'
services:
cas1:
container_name: cas1
image: cassandra:latest
volumes:
- /Development/PetProjects/CassandraTut/data/node1:/var/lib/cassandra/data
ports:
- 9042:9042
View keybase.md

Keybase proof

I hereby claim:

  • I am kadnan on github.
  • I am kadnan (https://keybase.io/kadnan) on keybase.
  • I have a public key ASAHNs8LV2Ck6XIFQPi-XKiD1amTKsrvPY8RTrvsBr13lwo

To claim this, I am signing this object:

@kadnan
kadnan / cl2.py
Created Oct 13, 2018
Anti Captcha test
View cl2.py
import requests
from bs4 import BeautifulSoup
from python_anticaptcha import NoCaptchaTaskProxylessTask, AnticaptchaClient
def get_token(s_key):
client = AnticaptchaClient(api_key)
task = NoCaptchaTaskProxylessTask(website_url=url,
website_key=s_key.strip())
job = client.createTask(task)
@kadnan
kadnan / consumer-notification.py
Created Jun 10, 2018
Consumer that notifies if calories count cross the threshold
View consumer-notification.py
import json
from time import sleep
from kafka import KafkaConsumer
if __name__ == '__main__':
parsed_topic_name = 'parsed_recipes'
# Notify if a recipe has more than 200 calories
calories_threshold = 200
View producer_consumer_parse_recipes.py
import json
from time import sleep
from bs4 import BeautifulSoup
from kafka import KafkaConsumer, KafkaProducer
def publish_message(producer_instance, topic_name, key, value):
try:
key_bytes = bytes(key, encoding='utf-8')
@kadnan
kadnan / producer-raw-recipies.py
Created Jun 10, 2018
methods to access recipes listing and extract markup
View producer-raw-recipies.py
def fetch_raw(recipe_url):
html = None
print('Processing..{}'.format(recipe_url))
try:
r = requests.get(recipe_url, headers=headers)
if r.status_code == 200:
html = r.text
except Exception as ex:
print('Exception while accessing raw html')
print(str(ex))
@kadnan
kadnan / producer-raw-recipies.py
Created Jun 10, 2018
methods to connect Kafa Producer and publishing data.
View producer-raw-recipies.py
def publish_message(producer_instance, topic_name, key, value):
try:
key_bytes = bytes(key, encoding='utf-8')
value_bytes = bytes(value, encoding='utf-8')
producer_instance.send(topic_name, key=key_bytes, value=value_bytes)
producer_instance.flush()
print('Message published successfully.')
except Exception as ex:
print('Exception in publishing message')
print(str(ex))
@kadnan
kadnan / fabfile
Created May 15, 2017
Gist for Automating remote and local git commands
View fabfile
from fabric.api import *
from fabric.colors import red, green
from time import sleep
from pprint import pprint
from fabric.contrib.files import exists
def local_git():
is_done = True
You can’t perform that action at this time.