Skip to content

Instantly share code, notes, and snippets.

View MrShameer's full-sized avatar
💼
Working

MrShameer MrShameer

💼
Working
View GitHub Profile
class VendingMachine:
notes = [20, 10, 5, 1]
drinks = {
"coke": 2.00,
"pepsi": 3.00,
"water": 1.00
}
def displayMenu(self):
for drink, price in self.drinks.items():
@MrShameer
MrShameer / PyQtScreenshot.py
Created November 3, 2022 07:19
Screenshot multiple monitor with PyQt5
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
class MyWidget(QtWidgets.QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle(" ")
self.begin = QtCore.QPoint()
self.end = QtCore.QPoint()
self.setWindowOpacity(0.3)
import random
import sys
from PySide2 import QtCore, QtGui, QtWidgets
class Tetris(QtWidgets.QMainWindow):
def __init__(self, *args, **kwargs):
super(Tetris, self).__init__(*args, **kwargs)
@MrShameer
MrShameer / mayaJoke.py
Last active October 28, 2022 09:26
A script to give random jokes in maya
from PySide2 import QtWidgets
import sys
from urllib import urlencode
import urllib2
import json
class UI(QtWidgets.QMessageBox):
def __init__(self, *args, **kwargs):
super(UI, self).__init__(*args, **kwargs)
self.setWindowTitle("Joke By Shameer (The Joke is not mine)")
@MrShameer
MrShameer / ShopeeApi.py
Created January 22, 2022 16:30
A way to fetch Shopee products information using Shopee API
import urllib.request, json
_KEYWORD = 'monitor' #PUT THE NAME OF THE PRODUCT YOU WANT TO SEARCH
_LIMIT = 100 #PUT THE AMOUNT OF PRODUCTS YOU WANT TO SEARCH FROM
with urllib.request.urlopen('https://shopee.com.my/api/v4/search/search_items?by=relevancy&keyword='+_KEYWORD+'&limit='+str(_LIMIT)+'&newest=0&order=desc&page_type=search&scenario=PAGE_GLOBAL_SEARCH&version=2') as url:
data = json.loads(url.read().decode())
for i in data['items']:
print('Title : '+i['item_basic']['name'].encode("ascii", "ignore").decode(),end='\n')
print('Stock : '+str(i['item_basic']['stock']),end='\n')
print('Rating : '+str(i['item_basic']['item_rating']['rating_star']),end='\n')
print('Rating according star : '+str(i['item_basic']['item_rating']['rating_count']),end='\n')
@MrShameer
MrShameer / InstaCommon.py
Last active September 7, 2021 19:19
A simple code to get two or more Instagram user's common followers or following
import instaloader
from instaloader import Profile
#to get followings of that username
def getfollowing(ids,lists):
profile = Profile.from_username(L.context, ids)
for followee in profile.get_followees(): #change to 'get_followers()' to get the persons followers
lists.append(followee)
def data(names):
<!DOCTYPE html>
<html>
<head>
<title>CSS Selector Tutorial</title>
<style type="text/css">
*{
text-align: center;
}
.space h3{ /*Every h3 Element inside .space are selected*/
@MrShameer
MrShameer / find_num.py
Created May 2, 2021 11:03
Code for multiplying smaller numbers then the user entered that have 7 or 3 in it. There are 3 different version of code and just use one version.
#uses library
import math
nums=[]
def check(n):
if '7' in str(n) or '3' in str(n):
print(n)
nums.append(int(n))
def start(n):
for i in range(0,n+1):