This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path | |
import numpy | |
import keyboard | |
import cv2 | |
count = 0 | |
img = cv2.VideoCapture(0) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
|---------------------| | |
|Individual exceptions for methods| | |
|---------------------| | |
""" | |
class ApplicationNameError(NameError): | |
""" | |
App with pointed out name not exist. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
NewerOlder