Skip to content

Instantly share code, notes, and snippets.

View SubhrajitPrusty's full-sized avatar
💭
procrastinating

Subhrajit Prusty SubhrajitPrusty

💭
procrastinating
View GitHub Profile
@SubhrajitPrusty
SubhrajitPrusty / gcd_lcm.py
Created January 7, 2018 17:44
LCM of a list of numbers
from functools import reduce
def gcd(a,b):
if b%a == 0:
return a
else:
return gcd(b%a, a)
def lcm(*args):
def lcm(a,b):
@SubhrajitPrusty
SubhrajitPrusty / gitseminar.md
Last active October 22, 2018 14:37
Topic Covered in Github Seminar [CODEX]

Github Seminar

Topics


  • What is Git and Github?
  • Usage of git and Github
  • Difference between git and Github.
  • Setting up Git on different platforms.

Github

@SubhrajitPrusty
SubhrajitPrusty / record_screen.sh
Last active March 10, 2021 14:32
Record screen using ffmpeg
# record for 30 seconds
# LINUX
ffmpeg -f x11grab -t 30 -i :0 -y record.mp4
# WINDOWS
ffmpeg -f gdigrab -t 30 -i desktop -y record.mp4
@SubhrajitPrusty
SubhrajitPrusty / sendMail.py
Last active October 22, 2018 14:36
Send a mail with python
import smtplib
import getpass
me = input("Enter sender email : ") # sender email, must enable LessSecureApps
user = me
pwd = getpass.getpass("Enter password for {} : ".format(user))
# you == the recipient's email address
you = input("Enter receiver email : ") # receiver email
msg = {}
@SubhrajitPrusty
SubhrajitPrusty / gifwall.sh
Last active October 24, 2018 20:21
Set an animated wallpaper
# use ffmpeg to get images from video
# ffmpeg -i input.mp4 -vf fps=30 ~/gif/giffy%03d.bmp
# gets 30 images per second
# use -ss to skip to time, and -t to set duration
# script is better than standalone command, due to behavior when force quitting
while true; do for i in ~/gif/*.*; do feh --bg-fill $i; done; done
@SubhrajitPrusty
SubhrajitPrusty / wallgen-vid.py
Last active September 14, 2019 20:53
Make a poly video using wallgen
from wallgen import *
import os
from PIL import Image
import numpy as np
import cv2
import sys
if len(sys.argv) < 1:
print("Needs file path ")
sys.exit(1)
@SubhrajitPrusty
SubhrajitPrusty / gradient-vid.py
Last active November 11, 2018 08:34
Make a gradient creation video
#! /usr/bin/python3
from wallgen import *
import os
from PIL import Image
import numpy as np
import cv2
import sys
ERASE_LINE = '\x1b[2K'
@SubhrajitPrusty
SubhrajitPrusty / wallgen-effect.py
Last active November 14, 2018 19:05
Make a video of polygonization of a picture from less polygons to more
#! /usr/bin/python3
from wallgen import *
import os
from PIL import Image
import numpy as np
import cv2
import sys
if len(sys.argv) < 1:
@SubhrajitPrusty
SubhrajitPrusty / palettegen.py
Last active November 23, 2018 11:33
Generate and show a palette from the current image, video or camera
from PIL import Image, ImageDraw
import cv2
import numpy as np
import os
import sys
if len(sys.argv) < 2:
print("Needs file path ")
sys.exit(1)
@SubhrajitPrusty
SubhrajitPrusty / codex_logo.png
Last active April 22, 2019 15:29
Create a wordcloud from Codex telegram group chat
codex_logo.png