Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Probably Coding || ! Probably Coding

Manash Kumar Mandal manashmandal

👨‍💻
Probably Coding || ! Probably Coding
View GitHub Profile
@manashmandal
manashmandal / cloudSettings
Last active Oct 16, 2021
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2021-10-16T17:27:58.934Z","extensionVersion":"v3.4.3"}
@manashmandal
manashmandal / egghead_downloader.py
Last active May 27, 2019
Egghead Course Download Script
View egghead_downloader.py
from lxml import html
import requests
import os
import json
from tqdm import tqdm
COURSES = """https://egghead.io/courses/cycle-js-fundamentals
https://egghead.io/courses/use-d3-v3-to-build-interactive-charts-with-javascript
@manashmandal
manashmandal / mongodb.sh
Last active Apr 21, 2019
Mongo Installation
View mongodb.sh
manash@XPS:/opt/robo3t$ sudo ln -s /opt/robo3t/bin/robo3t /usr/bin/robo3t
manash@XPS:/opt/robo3t$ nano ~/.local/share/applications/robo3t.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Robo3t
Exec=robo3t
Icon=/opt/robo3t/bin/logo-256x256.png
Terminal=false
Type=Application
@manashmandal
manashmandal / script.py
Created Mar 12, 2019
Asyncio send concurrent requests and save responses in mongo
View script.py
import asyncio
import aiohttp
import motor.motor_asyncio
client = motor.motor_asyncio.AsyncIOMotorClient()
db = client['async_db']
async_collection = db['async_collection']
async def send_request(session):
@manashmandal
manashmandal / script.py
Last active Mar 4, 2019
Batch Delete GitHub Forked Repository
View script.py
# Install tqdm and requests to run this script
import requests
from tqdm import tqdm
ACCESS_TOKEN = "ACCESS_TOKEN_WITH_DELETE_ACCESS"
USERNAME = "your-github-username"
LIST_REPOSITORY = "https://api.github.com/users/your-github-username/repos?page={}"
API_DELETE_REPO = "https://api.github.com/repos/your-github-username/{}"
View crop.py
def crop(image, ws=2, margin=7, scale_factor=0.5):
actual_border = None
img = np.copy(image)
hist = np.sum(img, axis=0)
# Keep only left half
hist = hist[ : len(hist) // 3 ]
View TextualSimilarity.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View imageutils.py
import os
from tqdm import tqdm
import cv2
import numpy as np
from pprint import pprint
from os.path import join
import glob
from sklearn.utils import shuffle
from keras.utils import to_categorical
View StreetviewTest.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View test.py
>>> R[0]
array([26801.16945753, 38668.6046967 , 34937.9753498 , 45478.98967837])
>>> R[1]
array([39823.04549356, 45055.11438545, 44048.634533 , 50008.11226016])
>>> zip(R[0], R[1])
[(26801.16945753, 39823.04549356), (38668.6046967, 45055.11438545), (34937.9753498, 44048.634533), (45478.98967837, 50008.11226016)]