Skip to content

Instantly share code, notes, and snippets.

View Anas-jaf's full-sized avatar
🎯
Focusing

Anas Mahmoud Anas-jaf

🎯
Focusing
View GitHub Profile
arr = document.querySelectorAll("a[jsname='UWckNb']")
// e[0].href
arr[0].href
for (let element of arr) {
console.log(element.href); // Logs the href of each element
}
import pandas as pd
import mysql.connector
# Replace 'your_file.xlsx' with the path to your Excel file
file_path = '07_محافظة_الكرك.xlsx'
df = pd.read_excel(file_path, skiprows=9)
data_dict = df.to_dict(orient='records')
db = mysql.connector.connect(
<!DOCTYPE html>
<html lang="ar" dir="rtl" class="rtl">
<head>
<meta charset="utf-8" />
<title>نظام إدارة المعلومات التربوية الاردن</title>
<link href="/openemis-core/favicon.ico" type="image/x-icon" rel="icon" />
<link
href="/openemis-core/favicon.ico"
type="image/x-icon"
/*
JSN-SR04T-V3.0 Ultrasonic Sensor - Mode 0 Demo
srt04-mode0.ino
Uses JSN-SR04T-V3.0 Ultrasonic Sensor
Displays on Serial Monitor
Mode 0 is default mode with no jumpers or resistors (emulates HC-SR04)
DroneBot Workshop 2021
https://dronebotworkshop.com
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLineEdit, QTableView, QHeaderView, QVBoxLayout, QLabel, QPushButton, QStackedWidget
from PyQt5.QtCore import Qt, QSortFilterProxyModel
from PyQt5.QtGui import QStandardItemModel, QStandardItem
class AppDemo(QWidget):
def __init__(self):
super().__init__()
self.resize(1600, 1200) # Increase the size of the second widget
mainLayout = QVBoxLayout()
import requests
proxies = {"http": "http://127.0.0.1:8080", "https": "http://127.0.0.1:8080"}
r = requests.get("https://www.google.com/", proxies=proxies, verify=False)
@Anas-jaf
Anas-jaf / all_word_pdf_excel_files_2Json.ps1
Last active August 24, 2023 00:04
all_word_pdf_excel_files_2Json.ps1
Get-ChildItem -Path C:\ -Recurse -Include *.docx, *.doc, *.dotx, *.dot, *.rtf, *.xlsx, *.xls, *.xlsm, *.xlsb, *.xlt, *.csv, *.pptx, *.ppt, *.pptm, *.potx, *.pot, *.pdf | ConvertTo-Json | Out-File -FilePath "office_files_and_pdfs.json"
import os
import win32com.client as win32
import xlwings as xw
def excelActiveSheet_to_pdf(excel_file_path, pdf_file_name, num_pages_to_export):
app = win32.DispatchEx("Excel.Application")
app.Interactive = False
app.Visible = False
workbook = app.Workbooks.Open(excel_file_path)
workbook.ActiveSheet.ExportAsFixedFormat(0 , pdf_file_name)
# Define the path to the Firefox executable
$firefoxPath = "C:\Program Files\Mozilla Firefox\firefox.exe"
# Get a list of all PDF files in the current directory
$pdfFiles = Get-ChildItem -Path . -Filter *.pdf
# Loop through the list and open each PDF file with Firefox
foreach ($pdfFile in $pdfFiles) {
$pdfFilePath = $pdfFile.FullName
$escapedFilePath = "`"$pdfFilePath`"" # Escape path with quotes for spaces