Skip to content

Instantly share code, notes, and snippets.

View rounakdatta's full-sized avatar

Rounak Datta rounakdatta

View GitHub Profile
@rounakdatta
rounakdatta / tiScraper.py
Created October 8, 2019 18:41
Structuring data from techinternship.io
import requests
from bs4 import BeautifulSoup
import re
import json
with requests.session() as s:
login_payload = {
"email": "xxx",
"password": "yyy"
}
@rounakdatta
rounakdatta / kijijiScraper.py
Last active October 18, 2019 20:08
Pick up name, phone numbers and emails from Kijiji
import sys
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver import ActionChains
import re
import codecs
[
{
"entry_point": "office_door2",
"entry_time": "2019-09-19 10:35:05",
"body_id": 1,
"label": "Carlos",
"exit_point": "office_door1",
"exit_time": "2019-09-19 10:35:33",
"recognition_time": 35
},
@rounakdatta
rounakdatta / lastFmScrobbles.js
Created September 7, 2019 10:30
Javascript to display your last.fm scrobbles on a front-end
var lastFmApiKey = "xxyy";
var settings = {
"async": true,
"crossDomain": true,
"url": "https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=rounakdatta&api_key=" + lastFmApiKey + "&format=json",
"method": "POST",
"headers": {
"Accept": "*/*",
"Cache-Control": "no-cache",
@rounakdatta
rounakdatta / esp32_ota_stm32.ino
Created September 6, 2019 19:43
Flash STM32 firmware from ESP32
#include <SPIFFS.h>
/*
*
* Copyright (C) 2017 CS.NOL https://github.com/csnol/1CHIP-Programmers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License,
* and You have to keep below webserver code
@rounakdatta
rounakdatta / snippet.js
Created August 7, 2019 19:15
Prevent accidental refreshes on webpages
window.onbeforeunload = function () {
return "Leave this page ?";
}
{
"labels": [{
"label": "Rosangela",
"x": -200,
"y": 200
},
{
"label": "Fabiana",
"x": -100,
"y": 300
GrLivArea SalePrice
1710 208500
1262 181500
1786 223500
1717 140000
2198 250000
1362 143000
1694 307000
2090 200000
1774 129900
@rounakdatta
rounakdatta / README.md
Last active June 23, 2019 06:24
gstreamer -> (tcp / zmq) and display it on the browser

Note that here streaming is occuring over TCP thereby would be supported by Firefox, and not Chrome.

@rounakdatta
rounakdatta / wordCount.py
Last active June 9, 2019 19:00
Word Counter implementations using Apache Spark
from pyspark.sql import SparkSession
# helper function to add
def addThem(x, y):
return x + y
# spark session object construction - remember there's only one session that's why getOrCreate
spark = SparkSession.builder.appName("wordCount").getOrCreate()
# read the file contents