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
# quitExcel.sh | |
# | |
# Function: quitExcel | |
# | |
# Description: | |
# Saves all open workbooks in Microsoft Excel and then quits the application, | |
# using AppleScript. Useful for closing Excel from the terminal and ensuring | |
# all data is saved. | |
# | |
# Usage: |
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
# my_activity_safari.sh | |
# | |
# Function: myActivitySafari | |
# | |
# Description: | |
# Preview your 50 most recent Safari browsing history entries on macOS, | |
# using Quick Look. This function queries Safari’s local SQLite history, | |
# previews the results, and removes the temporary file so it can be run | |
# again without file conflicts. | |
# |
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
# restart_pycharm.sh | |
# | |
# A shell function to gracefully restart PyCharm on macOS. | |
# Usage: source this file or copy the function into your ~/.zshrc or ~/.bashrc, | |
# then run `restartPyCharm` from your terminal. | |
# You may need to verify the Quit PyCharm shortcut key from the menu: Command + Shift + 9 | |
# | |
# Author: SHi-ON | |
restartPyCharm() { |
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
### Keybase proof | |
I hereby claim: | |
* I am shi-on on github. | |
* I am azdam (https://keybase.io/azdam) on keybase. | |
* I have a public key ASDbCk069qRAF9v2CwpJQFr89wJOeq_0JNSqDPsoubzthgo | |
To claim this, I am signing this object: |
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
WEBVTT | |
Kind: captions | |
Language: en | |
00:00:01.879 --> 00:00:05.660 align:start position:0% | |
are<00:00:02.879><c> you</c><00:00:03.030><c> done</c><00:00:03.270><c> with</c><00:00:03.449><c> your</c><00:00:03.780><c> chunk</c><00:00:04.650><c> yet</c><00:00:04.890><c> almost</c> | |
00:00:05.660 --> 00:00:05.670 align:start position:0% | |
are you done with your chunk yet almost |
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
(() => { | |
let count = 0; | |
function getAllButtons() { | |
return document.querySelectorAll('button.artdeco-button--2.artdeco-button--secondary') || []; | |
} | |
async function unfollowAll() { | |
const buttons = getAllButtons(); | |
for (let button of buttons) { | |
if (button){ | |
button.click(); |
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 concurrent.futures | |
import itertools | |
import math | |
import pdf2image # $ brew install poppler | |
from tqdm import tqdm | |
BLACK = (0, 0, 0) | |
RED = (255, 0, 0) | |
GREEN = (0, 255, 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
from pyrogram import Client | |
with Client(CLIENT_NAME, API_ID, API_HASH) as client: | |
chats = [] | |
for d in client.get_dialogs(): | |
if d.chat.is_creator or \ | |
(d.chat.permissions and d.chat.permissions.can_change_info): | |
chats.append(d.chat.title) | |
print(*chats, sep='\n') | |
print('\t Chat count:', len(chats)) |
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 logging | |
import pathlib | |
import sys | |
from ml.common.const import LOG_DIR_PATH, ML_DIR | |
def create_log_file_path(file_path, root_dir=ML_DIR, log_dir=LOG_DIR_PATH): | |
path_parts = list(pathlib.Path(file_path).parts) | |
relative_path_parts = path_parts[path_parts.index(root_dir) + 1:] |
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 base64 | |
import mimetypes | |
import os | |
from bs4 import BeautifulSoup | |
with open('example.html', 'rb') as file_handle: # Read in as a binary file | |
soup = BeautifulSoup(file_handle) |
NewerOlder