Skip to content

Instantly share code, notes, and snippets.

View mattsegura's full-sized avatar
🎯
Focusing

Matthew mattsegura

🎯
Focusing
View GitHub Profile
@mattsegura
mattsegura / main.py
Created January 29, 2023 23:35
Monitor Flipper zero website for restock on product
import requests
from bs4 import BeautifulSoup
import time, random
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.3'
}
def check_product_status():
@mattsegura
mattsegura / main.py
Created November 12, 2022 05:25
selenium implicit and explicit waiting example
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome()
driver.get("https://webscraper.io/test-sites/e-commerce/allinone")
home_button = driver.find_element(by=By.CLASS_NAME, value="active")
@mattsegura
mattsegura / convert.py
Last active October 25, 2022 17:55
Convert images in a folder into greyscale
import cv2
import os,glob
from os import listdir,makedirs
from os.path import isfile,join
path = '' # folder you want to read from
dstpath = '' # folder you want to output results
try:
git remote add origin https://<TOKEN>@github.com/<USERNAME>/<REPO>.git
@mattsegura
mattsegura / mapping.sol
Last active January 15, 2022 20:05
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.11+commit.22be8592.js&optimize=false&runs=200&gist=
pragma solidity ^0.5.11;
// Mapping
// Create mapping
// Get the value
// Set the value
// Delete the value
contract Mapping {
// data base for storing names
@mattsegura
mattsegura / forloop.cpp
Created December 6, 2020 04:39
Intilization and test will have max and min, Initilization with min and test with max
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
// constants
const int START_KPH = 60,
END_KPH = 130,
@mattsegura
mattsegura / inputval.cpp
Created December 5, 2020 21:36
simple input validation loop
#include <iostream>
using namespace std;
int main()
{
const int min_num = 10,
max_num = 25;
int number;
@mattsegura
mattsegura / simplewhileloop.cpp
Created December 5, 2020 06:30
application utilizing while loops, certain temp standard and tells the user to input again until theres an acceptable value
#include <iostream>
using namespace std;
int main()
{
double substance;
cout << "Enter the subtance tempteture: ";
cin >> substance;
@mattsegura
mattsegura / bookpointsystem.cpp
Created December 4, 2020 08:21
simple else if statement utilizing a menu system
#include <iostream>
using namespace std;
int main()
{
int books, points, month;
cout << "How many books have you purchased this semester?\n";
cin >> books;
// book discounts
#include <iostream>
using namespace std;
int main()
{
const double book_price = 5.00;
// Variables