Skip to content

Instantly share code, notes, and snippets.

View RahulDas-dev's full-sized avatar
🏠
Working from home

Rahul Das RahulDas-dev

🏠
Working from home
View GitHub Profile
@RahulDas-dev
RahulDas-dev / init.vim
Last active March 5, 2021 11:04
My vimrc File With Plugins & Other Details
set nocompatible
filetype off
call plug#begin('~/.config/nvim/plugged')
" Declare the list of plugins.
Plug 'preservim/nerdtree'
Plug 'morhetz/gruvbox'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
Plug 'vim-airline/vim-airline'
@RahulDas-dev
RahulDas-dev / git-prompt.sh
Created February 26, 2021 19:28
git-promt.sh for git bash Terminal
PS1='\[\033]0;$TITLEPREFIX \007\]' # set window title
PS1="$PS1"'\n' # new line
PS1="$PS1"'\[\033[32m\]' # change to green
PS1="$PS1"'\h ' # user@host<space>
PS1="$PS1"'\[\033[35m\]' # change to purple
PS1="$PS1"'\[\033[33m\]' # change to brownish yellow
PS1="$PS1"'\w' # current working directory
if test -z "$WINELOADERNOEXEC"
then
COMPLETION_PATH="${COMPLETION_PATH%/lib/git-core}"

List of basic Python Packages for Linting,Formating and Jupyter notebook requirement_commnon.txt

Package Name Package description
pylint Python Linter/A simple program which checks Python source files code for errors
autopep8 autopep8 automatically formats Python code to conform to the PEP 8 style guide
flake8
flake8-import-order
flake8-builtins
flake8-logging-format
@RahulDas-dev
RahulDas-dev / image_download.py
Last active April 16, 2021 10:17
Image Download using Python3
import os
import shutil
import pandas as pd
import requests
datadir = '/your/path/to/url_csv/file/ulfile.csv' # Change this variable and point 2 sitable csv file path
downloadDir='/your/path/to/download/directory' # Change this variable and point 2 image download directory
@RahulDas-dev
RahulDas-dev / data clean.md
Last active May 23, 2021 17:24
Pandas data frame cleaning and house keeping

Import statement

import os
import gc

import pandas as pd
@RahulDas-dev
RahulDas-dev / Create Virtual Enviroment.md
Last active August 20, 2022 15:04
Python virtual environment creation using venv module

Create Environment using venv Module

  • For Windows python -m venv --prompt <venv_promt> <venv_directory>
  • For Linux python3 -m venv --prompt <venv_promt> <venv_directory>

Activate Environment

  • For Windows <venv_directory>\Scripts\activate.bat
  • For Linux source <venv_directory>/bin/activate

Check Environment Creation

@RahulDas-dev
RahulDas-dev / app_config.rs
Last active December 4, 2021 13:25
tauri app App_config Object
use std::path::PathBuf;
use std::default::Default;
use std::{fs::File, fs};
use std::io::{prelude::*,Error,ErrorKind};
use serde::{Serialize, Deserialize};
use tauri::{Size,PhysicalSize, Position, PhysicalPosition};
pub mod config_plugin;
@RahulDas-dev
RahulDas-dev / config_plugin.rs
Last active December 4, 2021 13:26
App Config Plug in defination
use tauri::{plugin::Plugin, Runtime, Invoke, State, Window, PageLoadPayload, Manager};
use tauri::async_runtime::Mutex;
use std::sync::Arc;
use super::AppConfig;
type Tconfig = Arc<Mutex<AppConfig>>;
pub struct ConfigPlugin<R: Runtime> {
invoke_handler: Box<dyn Fn(Invoke<R>) + Send + Sync>,
}
@RahulDas-dev
RahulDas-dev / startup.ts
Last active December 3, 2021 08:04
How To trigger commands from Frontend to change the state object
private registerListeners() {
appWindow.listen('config-init', event => {
console.log('registerListeners :', event.payload, event.event)
})
appWindow.listen('page-loaded', event => {
//console.log('page-loaded :', event.payload, event.event)
appWindow.show()
})
appWindow.once('tauri://close-requested', this.window_close_handeler)
appWindow.once('tauri://destroyed', this.window_close_handeler)
@RahulDas-dev
RahulDas-dev / Sqlx_Sqlite.rs
Last active February 17, 2023 07:57
Sqlx::Sqlite Integration with Rust
/*
[dependencies]
sqlx = { version = "0.5.9", features = [ "runtime-async-std-native-tls", "sqlite" ] }
async-std = { version = "1.6", features = [ "attributes" ] }
futures = "0.3.18"
*/
use std::result::Result;
use sqlx::{sqlite::SqliteQueryResult, Sqlite, SqlitePool, migrate::MigrateDatabase};