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 requests | |
from bs4 import BeautifulSoup | |
import os | |
import PyPDF2 | |
EXAM_DIRECTORY_PATH = "./exams" | |
SOLUTION_DIRECTORY_PATH = "./solutions" | |
# parse page | |
url = "https://dbai.tuwien.ac.at/education/ssd/pruefung/" |
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
// open up "https://git.logic.at/.../stundenlisten/your_name.csv" | |
// then run this in your javascript console | |
const sum = Array.from(document.querySelectorAll('td:nth-child(3)')) | |
.map((cell) => parseFloat(cell.textContent.trim()) || 0) | |
.reduce((acc, val) => acc + val, 0) | |
const sws = sum / 25 | |
console.log(`total: ${sum}h ⌛️ -- equivalent to ${sws} SWS (semester wochenstunden)`) |
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
// ==UserScript== | |
// @name WhatsApp Chats | |
// @namespace sueszli | |
// @match *://*web.whatsapp.com/* | |
// @grant none | |
// @version 1.0 | |
// @author sueszli | |
// @description Simple utility functions to read chat elements from active and archived chats. | |
// ==/UserScript== |
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
from PyPDF2 import PdfFileMerger | |
import os | |
inputPath = "./extractedPages" | |
total = len(os.listdir(inputPath)) | |
count = 1 | |
merger = PdfFileMerger() | |
for pdf in os.listdir(inputPath): | |
merger.append(open(inputPath + "/" + pdf, "rb")) |
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
from reportlab.pdfgen import canvas | |
from PyPDF2 import PdfFileWriter, PdfFileReader | |
import webbrowser | |
inputPath = "input.pdf" | |
outputPath = "output.pdf" | |
imgPath = "logo.png" | |
tempPath = "temp.pdf" | |
imgSize = 70 | |
x = 500 |
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
from PyPDF2 import PdfFileReader, PdfFileWriter | |
import os | |
inputPath = "./solutions" | |
outputPath = "./extractedPages" | |
chosenPages = [1] | |
if not os.path.exists(outputPath): | |
os.makedirs(outputPath) |
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 axios from 'axios' | |
import * as cheerio from 'cheerio' | |
import { assert } from 'console' | |
import open from 'open' | |
const main = async () => { | |
let url = process.argv[2] | |
assert(process.argv.length !== 2, 'illegal number of arguments') | |
assert(url, 'missing url as argument') |
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
const { join } = require("path"); | |
module.exports = { | |
cacheDirectory: join(__dirname, ".cache", "puppeteer"), | |
}; |
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 { assert, log } from 'console' | |
import fs from 'fs' | |
import playwright from 'playwright' | |
const DOWNLOAD_PATH = 'downloads' | |
const main = async () => { | |
console.clear() | |
// init download dir |
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 webbrowser | |
import time | |
from playwright.sync_api import sync_playwright | |
URL = "https://www.amazon.jobs/en/search?___________INSERT YOUR URL HERE___________" | |
page = sync_playwright().start().chromium.launch().new_page() | |
page.goto(URL) |
OlderNewer