Skip to content

Instantly share code, notes, and snippets.

import requests
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import os
def download_req(url, name):
@hpcdisrespecter
hpcdisrespecter / padder.sh
Last active March 20, 2025 12:42
Center and pad cartesian POSCAR
#!/bin/bash
if [ $# -ne 2 ]; then
echo "Usage: $0 <file> <amount>"
exit 1
fi
if [ "$2" -lt 0 ]; then
echo "Amount must be positive"
exit 1
fi
## NOTES
#
# - You will need to change your drive settings to make this work for you
# - You will need OVMF somewhere (https://github.com/tianocore/tianocore.github.io/wiki/OVMF)
# - You will need a OSK key from TIM APPLE so it boots (see https://sive.host/index.php/knowledgebase/388/Installing-macOS-12-Monterey-on-Proxmox-7.html)
qemu-system-x86_64 \
-enable-kvm \
-machine q35 \
module Main where
import Control.Monad (when)
import Control.Monad.State (StateT, execStateT, get, put, modify, gets, lift)
import Data.List (intercalate, find, sortBy)
import System.Environment (getArgs)
import System.IO (hSetEcho, hSetBuffering, stdin, stdout, BufferMode(NoBuffering), hFlush)
import System.Random (randomRIO)
import System.Exit (exitSuccess)
import Data.Maybe (isJust)
@hpcdisrespecter
hpcdisrespecter / init.lua
Created March 17, 2025 16:28
idk famalam neovim init.lua it's not really hard
-- -*- lua -*-
-- We use Packer for package management
local function bootstrap_pckr()
local pckr_path = vim.fn.stdpath("data") .. "/pckr/pckr.nvim"
if not vim.uv.fs_stat(pckr_path) then
vim.fn.system({
'git',
'clone',
@hpcdisrespecter
hpcdisrespecter / spacecadet.json
Created March 20, 2025 16:32
Representation of the Space Cadet APL Keyboard
[
{
"backcolor": "#dbd3d3"
},
[
{
"c": "#0073a2",
"t": "#CCCCB7",
"p": "SA",
"a": 7,
@hpcdisrespecter
hpcdisrespecter / jellyfin.cfg
Created March 31, 2025 21:08
A Jellyfin server config for nginx
server {
server_name YOUR_SERVER_LOCATION;
listen 443 ssl http;
#listen [::]:443 ssl http;
client_max_body_size 20M;
resolver 127.0.0.1 valid=30;
ssl_certificate /etc/letsencrypt/live/YOUR_VALUE_HERE/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/YOUR_VALUE_HERE/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
#!/usr/env/bin python
# -*- coding: utf-8 -*-
'''
Description: This code demonstrates the following:
- Pythonic loops are slow
- List comprehensions are faster
- vectorized operations like numpy are faster than list comprehensions
- parallel computing is faster than vectorized operations for large datasets
- Just-In-Time (JIT) compilation can speed up Python code
@hpcdisrespecter
hpcdisrespecter / webp-daemon.rc
Created April 3, 2025 12:58
Convert webp automation for systemd/openrc
#!/sbin/openrc-run
# /etc/init.d/webp-daemon
name="WebP Conversion Daemon"
description="Monitors and converts WebP files in home directory"
supervisor="supervise-daemon"
command="/usr/local/bin/webp-daemon.sh"
command_user="${RC_SVCNAME##*.}"
: ${command_user:=nobody}
from flask import Flask, request, jsonify, send_file
from flask_cors import CORS
from rdkit import Chem
from rdkit.Chem import Draw, AllChem
from PIL import Image
import io
import base64
import logging
import json
import os