Skip to content

Instantly share code, notes, and snippets.

View manashmandal's full-sized avatar
👨‍💻
Probably Coding || ! Probably Coding

Manash Kumar Mandal manashmandal

👨‍💻
Probably Coding || ! Probably Coding
View GitHub Profile
@manashmandal
manashmandal / egghead_downloader.py
Last active May 27, 2019 20:51
Egghead Course Download Script
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 April 21, 2019 16:23
Mongo Installation
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 March 12, 2019 06:15
Asyncio send concurrent requests and save responses in mongo
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):
#include "SerialPort.h"
SerialPort::SerialPort(char *portName)
{
this->connected = false;
this->handler = CreateFileA(static_cast<LPCSTR>(portName),
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
#ifndef SERIALPORT_H
#define SERIALPORT_H
#define ARDUINO_WAIT_TIME 2000
#define MAX_DATA_LENGTH 255
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
@manashmandal
manashmandal / script.py
Last active March 4, 2019 05:46
Batch Delete GitHub Forked Repository
# 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/{}"
@manashmandal
manashmandal / store.md
Last active February 16, 2019 09:03
Bangladesh Electronics Store
@manashmandal
manashmandal / instructions.md
Created June 13, 2017 04:27 — forked from mcescalante/instructions.md
Run a Flask application with gunicorn and nginx

This guide assumes:

  • You have a VPS (something like DigitalOcean, Linode, etc.)
  • You have a Flask application and a basic understanding of command line instructions
  • You've got nginx installed and know where your configuration files are

Instructions

  1. First, you should install gunicorn on your box or virtualenv with pip:
@manashmandal
manashmandal / qsettingsexample.h
Last active November 1, 2018 02:29
medium post
#ifndef QSETTINGSEXAMPLE_H
#define QSETTINGSEXAMPLE_H
#include <QDialog>
#include <QString>
#include <QSettings>
#include <QLineEdit>
#include <QPushButton>
namespace Ui {
import numpy as np
import librosa
def wav2mfcc(file_path, max_pad_len=11):
wave, sr = librosa.load(file_path, mono=True, sr=None)
wave = wave[::3]
mfcc = librosa.feature.mfcc(wave, sr=16000)
pad_width = max_pad_len - mfcc.shape[1]
mfcc = np.pad(mfcc, pad_width=((0, 0), (0, pad_width)), mode='constant')
return mfcc