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 json | |
# Function to format notes for printable output | |
def format_notes(notes, width=50): | |
formatted_notes = "" | |
for i in range(0, len(notes), width): | |
formatted_notes += notes[i:i+width] + "\n" | |
return formatted_notes | |
# Read the Bitwarden JSON export and create a printable TXT file |
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
# chatgpt generated | |
# but verified | |
import os | |
import shutil | |
import zipfile | |
import tarfile | |
from pathlib import Path | |
def decompress_files(): |
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
# make sure your dns is setup to forward your domain, in this case excalidraw.my-custom-domain.com to the server you're hosting this on | |
excalidraw.my-custom-domain.com { | |
reverse_proxy http://excalidraw { | |
header_up Host {http.request.host} | |
header_up X-Real-IP {remote_host} | |
header_up X-Forwarded-For {remote_host} | |
header_up X-Forwarded-Proto {scheme} | |
} | |
} |
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
func get_events(account_count int, event_count int) []Event { | |
events := make([]Event, 0, account_count*event_count) | |
event_counter := make(map[string]int) | |
for i := 0; i < account_count*event_count; i++ { | |
keyA := string(97 + rand.Intn(account_count-1)) | |
keyB := string(97 + rand.Intn(account_count-1)) | |
for { | |
if keyA != keyB { | |
break | |
} |
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 subprocess | |
import requests | |
# Replace with your GitHub token | |
GITHUB_TOKEN = '' | |
# Replace with your private Git server's HTTPS URL | |
PRIVATE_GIT_SERVER = 'https://user_name:pat@domain/user_name/' | |
GIT_SERVER_USERNAME = 'john' |
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
#!/bin/python | |
import argparse | |
import asyncio | |
import datetime | |
from multiprocessing import Pool | |
async def write(i): | |
while True: | |
print(f"{i} {str(datetime.datetime.now())}") |
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 OpenSections() { | |
console.log('Opening Sections...'); | |
var index = 0; | |
var sectionPush = document.querySelectorAll('.js-panel-toggler') | |
var sectionHidden = document.querySelectorAll('.panel--content-wrapper--1g5eE') | |
sectionHidden.forEach((item) => { | |
const hidden = item.getAttribute('aria-hidden'); | |
if (hidden == "true") { | |
sectionPush[index].click(); | |
} |
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
#! /bin/bash | |
fileName="/home/john/speed-log/speed_log.txt" | |
echo "$(speedtest-cli --csv --csv-delimiter ';')" >> $fileName |
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 json | |
inp = "" | |
out = "" | |
with open(inp, "r", encoding="utf-8") as f: | |
with open(out, "w", encoding="utf-8") as f2: | |
json.dump(json.load(f), f2, indent=2, ensure_ascii=False) |