Skip to content

Instantly share code, notes, and snippets.

@RakeshChouhan
RakeshChouhan / TakeScreenshot.py
Created December 19, 2019 11:31
Takes screenshot from your system
import pyautogui
import tkinter as tk
from tkinter import filedialog
import keyboard
root= tk.Tk()
canvas1 = tk.Canvas(root, width = 300, height = 300)
canvas1.pack()
@RakeshChouhan
RakeshChouhan / youtubedownload.py
Created November 2, 2019 17:47
You tube downloader
from pytube import YouTube
yt=YouTube("https://www.youtube.com/watch?v=oIciz6CSSVQ")
stream = yt.streams.first()
stream.download()
@RakeshChouhan
RakeshChouhan / Abbreviation.py
Created September 14, 2019 18:11
Register config file with the abbreviation
import keyboard as k
f = open('config.txt','r')
records = f.read()
recs = records.split('\n')
for i in recs:
if(i != ''):
data = i.split(':')
k.add_abbreviation(data[0],data[1])
print(data[0])
@RakeshChouhan
RakeshChouhan / CliboardShortcuts
Last active September 14, 2019 17:50
Python program to register keyboard shortcuts for the selected clipboard text
# these hotkey and abbreviation works on all the application like chrome or any other tool
import pyperclip as p
import webbrowser as w
import keyboard as k
k.add_hotkey('shift+w', lambda: w.open_new_tab(p.paste()))
k.add_hotkey('shift+m', lambda: w.open_new_tab('https://www.google.com/search?q='+p.paste()))
# abbreviation
@RakeshChouhan
RakeshChouhan / WebComponent.js
Created June 17, 2018 15:43
Web component creation without any framework.
class PopUpInfo extends HTMLElement{
constructor(){
super();
this.attachFunctionality();
}
attachFunctionality(){
var shadow = this.attachShadow({mode:'open'});
var span = document.createElement("span");
span.innerHTML = "Hi Rakesh! your first html Element... Congratulations ...";
shadow.appendChild(span);
var express = require("express");
var app = express();
app.get("/", function(req, res){
res.send("Get methods");
});
app.use(express.static("public")); // put the static data folder name here which contain your UI code.
@RakeshChouhan
RakeshChouhan / DivisionActor.java
Created July 10, 2016 11:22
Fault tolerance code sample with AKKA and JAVA.
/**
*
*/
package com.akkasample.actor;
import com.akkasample.bean.DivOperands;
import akka.actor.UntypedActor;
import scala.Option;
@RakeshChouhan
RakeshChouhan / ActorInboxMain.java
Created May 1, 2016 15:26
AKKA sample to demonstrate the message communication between actors using Inbox.
package com.akkasample.inbox;
import java.util.concurrent.TimeUnit;
import com.akkasample.actor.InboxSampleActor;
import com.akkasample.bean.Greeting;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Inbox;
@RakeshChouhan
RakeshChouhan / AkkaSampleMain.java
Created April 30, 2016 16:53
Main program with the AKKA.
/**
*
*/
package com.akkasample;
import com.akkasample.actor.MessageActor;
import com.akkasample.bean.Greeting;
import akka.actor.ActorRef;
import akka.actor.ActorSelection;
@RakeshChouhan
RakeshChouhan / DownloadSSLCertificate
Last active August 29, 2015 14:20
SSL certificate download from the https server so you dont have to manually download it through browser or keytool.
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.HttpsURLConnection;