Skip to content

Instantly share code, notes, and snippets.

View readpan's full-sized avatar

Olivia Martinez readpan

View GitHub Profile
@readpan
readpan / remove_pdf_annotations.py
Created August 29, 2023 05:14
Remove all annotations of PDF file
import PyPDF2
pdf_path = '/your/path/to/pdf'
pdf_save_path = '/your/path/to/save/pdf'
# This attempts to remove annotations
with open(pdf_path, 'rb') as pdf_obj:
pdf = PyPDF2.PdfFileReader(pdf_obj)
pdf_out = PyPDF2.PdfFileWriter()
# remove all annotations
@readpan
readpan / autoexec.cfg
Created May 20, 2023 05:14 — forked from razlebol/autoexec.cfg
dota2 autoexec
con_enable "1"
dota_disable_range_finder "1" // Visual spell range indicator activated (default 1)
dota_minimap_hero_size "800" // Slightly bigger hero icons on minimap (default 600)
dota_minimap_misclick_time "0.3" // Threshold delay to accept minimap clicks (default 0.2)
dota_camera_accelerate "20" // Decelerating map scroll (50 = insta stop, 1 = smooth slowdown, vanilla DotA would be 50)
dota_player_multipler_orders "1" // Control all units with CTRL click (default 0)
dota_player_units_auto_attack "0" // Hero autoattack disabled (default 1)
dota_always_show_player_names "1" // Always show player names
import json
import asyncio
import aiohttp
from random import randint
class Queue:
def __init__(self, concurrency_limit):
self.semaphore = asyncio.Semaphore(concurrency_limit)
@readpan
readpan / AudioPlayer.cs
Created May 12, 2023 02:51
Base64 string convert to ogg file, play as AudioClip in Unity
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.Networking;
namespace DefaultNamespace.Scripts
{
public static class AudioPlayer
@readpan
readpan / mac_displayplacer.py
Last active March 6, 2023 06:31
MacOS利用displayplacer命令行工具设置分辨率
#!/usr/bin/env python3
import subprocess
import sys
import json
# Run the command and capture the output
output_bytes = subprocess.check_output(
["/opt/homebrew/bin/displayplacer", "list"])
# Decode the output bytes into a string
@readpan
readpan / trial.key
Created September 12, 2017 02:20 — forked from huqi/trial.key
Beyond Compare 4 license for Mac
Beyond Compare 4
Licensed to: ASIO Allsoftinone
Quantity: 1 user
Serial number: 1822-9597
License type: Pro Edition for Windows
--- BEGIN LICENSE KEY ---
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t