Skip to content

Instantly share code, notes, and snippets.

View Alexandro1112's full-sized avatar
🏠
Working from home

Alexandro1112

🏠
Working from home
View GitHub Profile
import os
import sqlite3
from Foundation import NSDate
def get_safari_history():
history_db_path = os.path.expanduser('~/Library/Safari/History.db')
conn = sqlite3.connect(history_db_path)
cursor = conn.cursor()
import os
import sqlite3
from Foundation import NSDate
def get_safari_history():
history_db_path = os.path.expanduser('~/Library/Safari/History.db')
conn = sqlite3.connect(history_db_path)
cursor = conn.cursor()
import os
import AVFoundation
from Cocoa import NSImage, NSData, NSBitmapImageRep, NSBitmapImageFileTypeJPEG
import warnings
def extract_frames(video_path, output_dir, frame_rate):
if not os.path.exists(output_dir):
os.makedirs(output_dir)
url = AVFoundation.NSURL.fileURLWithPath_(video_path)
"""The code defines a BluetoothManager class that manages Bluetooth functionality using the CoreBluetooth framework.
It initializes a central Bluetooth manager, listens for Bluetooth state changes, and scans for nearby Bluetooth peripherals. It captured it and return."""
import time
from Foundation import NSObject, NSRunLoop, NSDefaultRunLoopMode, NSDate, NSUUID
from CoreBluetooth import (CBCentralManager, CBManagerStatePoweredOn,
CBManagerStatePoweredOff, CBCentralManagerScanOptionAllowDuplicatesKey,
NSKeyValueObservingOptionNew, CBCentralManagerScanOptionAllowDuplicatesKey, NSLog,
CBConnectPeripheralOptionNotifyOnConnectionKey, CBConnectPeripheralOptionNotifyOnDisconnectionKey,
NSDictionary, CBAdvertisementDataLocalNameKey)
@Alexandro1112
Alexandro1112 / catDetectFace.py
Created March 21, 2023 16:37
Opencv script Opencv script
import os.path
import numpy
import keyboard
import cv2
count = 0
img = cv2.VideoCapture(0)
#!/Users/steve/.pyenv/shims/python
# Thing to make new desktop backgrounds from my folder of research images
# On Linux I made this actually write to the desktop directly using feh, however, that's not really possible on a Mac. So I had it create a folder of graphics and then have the desktop settings choose from that directory at random.
from PIL import Image, ImageDraw
import os, random
from subprocess import call
## Colors from the Nord color scheme,
@Alexandro1112
Alexandro1112 / exceptions.py
Created January 26, 2023 08:13
exceptions for pyTerminalproccesosx
"""
|---------------------|
|Individual exceptions for methods|
|---------------------|
"""
class ApplicationNameError(NameError):
"""
App with pointed out name not exist.
"""

Hi there, I'm Aleksandr

Python-Developer,
from Russia πŸ‡·πŸ‡Ί.
In the free time adore learn history, explore physic.Strive for the best! πŸ”

@Alexandro1112
Alexandro1112 / cmds.sh
Created January 22, 2023 21:48
Commands
# Main commands in library (notifies)
terminal-notifier -message "Hello, this is my message" -title "Message Title"
osascript -e 'display notification "Notification text" with title "Notification Title" subtitle "Notification sub-title" sound name "Pop"'
[submodule "blueutil"]
path = blueutil
url = https://github.com/toy/blueutil
[submodule "brightness"]
path = brightness
url = https://github.com/nriley/brightness
[submodule "brew"]
path = brew
url = https://github.com/Homebrew/brew