This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Google Search Query Generator</title> | |
<style> | |
body { | |
font-family: Arial, sans-serif; | |
margin: 0; |
This file contains 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
function search(obj, string) { | |
const maxDepth = 10; | |
const excludeKeys = ["_root"]; | |
function isObject(val) { | |
return typeof val === "function" || typeof val === "object"; | |
} | |
function traverse(obj, depth, path) { | |
// Guard clause |
This file contains 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 time | |
import getpass | |
import argparse | |
import logging | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.support.wait import WebDriverWait |
This file contains 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 json | |
import spotipy | |
from tqdm import tqdm | |
from spotipy.oauth2 import SpotifyOAuth | |
def get_client(): | |
"""Get Spotify Client.""" |
This file contains 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
document.addEventListener('keydown', function(event) { | |
// Map the "." key with previous image in post. | |
if (event.keyCode === 188) { | |
let backButton = document.querySelector('button[aria-label="Go back"]'); | |
if (backButton) { | |
backButton.click(); | |
} | |
} | |
// Map the "," key with next image in post. |
This file contains 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
async function replacePDF(item) { | |
// filter annotations, attachments, notes | |
if (!item.isRegularItem()) { | |
return; | |
} | |
let fileExists = []; | |
let oldPDF = null; | |
// filter multiple or existing PDFs | |
const attachmentIDs = item.getAttachments(); | |
for (let itemID of attachmentIDs) { |
This file contains 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
# pip install pypdf | |
from pypdf import PdfReader, PdfWriter | |
from pypdf.generic import NameObject, NumberObject | |
from pypdf.constants import FieldDictionaryAttributes as FA | |
MIN_HEIGHT = 30 | |
reader = PdfReader("locked.pdf") |
This file contains 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 time | |
import getpass | |
import argparse | |
import logging | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.support.wait import WebDriverWait |
This file contains 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 torch | |
import subprocess | |
import time | |
import logging | |
# Takes about 8GB | |
ndim = 25_000 | |
logging.basicConfig(format='[%(asctime)s] %(filename)s [%(levelname).1s] %(message)s', level=logging.DEBUG) | |
def get_gpu_usage(): |
This file contains 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
# This script is designed to convert bank statements from pdf to excel. | |
# | |
# It has been tweaked on HDFC Bank Credit Card statements, | |
# but in theory you can use it on any PDF document. | |
# | |
# The script depends on camelot-py, | |
# which can be installed using pip | |
# | |
# pip install "camelot-py[cv]" |
NewerOlder