Skip to content

Instantly share code, notes, and snippets.

View DDoSolitary's full-sized avatar
📚
Doing homework

DDoSolitary DDoSolitary

📚
Doing homework
View GitHub Profile
@DDoSolitary
DDoSolitary / normalize-ass-font.sh
Last active August 10, 2017 15:36
Normalize font settings for ass subtitle files
#!/bin/bash
for i in *.ass; do
sed -i "s/\(\\\\fn@\?\)[^\}]*/\1$FONT/g" "$i"
sed -i "s/^\(Style: [^,]*,@\?\)[^,]*/\1$FONT/" "$i"
done
@DDoSolitary
DDoSolitary / hwaccel-auto-config.sh
Last active February 19, 2022 02:26
Automatically configure hardware acceleration on Arch Linux.
#!/bin/bash
unset LIBVA_DRIVER_NAME VDPAU_DRIVER DRI_PRIME
if lspci -k | grep -q -e amdgpu -e radeon; then
export LIBVA_DRIVER_NAME=radeonsi
export VDPAU_DRIVER=radeonsi
elif lspci -k | grep -q nouveau; then
export LIBVA_DRIVER_NAME=nouveau
export VDPAU_DRIVER=nouveau

Keybase proof

I hereby claim:

  • I am ddosolitary on github.
  • I am ddosolitary (https://keybase.io/ddosolitary) on keybase.
  • I have a public key ASAGJ1DvvlVO0TnQg5loqq9XtopKkMQIzEi_XqzwYwSQjQo

To claim this, I am signing this object:

@DDoSolitary
DDoSolitary / arknights-inf-practice.py
Created July 27, 2019 12:21
mitmproxy的明日方舟无限演习插件
import uuid
import json
from mitmproxy import http
from mitmproxy import ctx
class ArknightsPlugin:
def __init__(self):
self.started = False
def request(self, flow) -> None:
url = flow.request.pretty_url
if url.startswith("https://ak-gs.hypergryph.com:8443/"):
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
This is the checkstyle configuration file used for Object-Oriented class, simplified from google official code style.
Some helpful information:
Google official code style: https://google.github.io/styleguide/javaguide.html
#!/usr/bin/env python3
import functools
import json
import math
import multiprocessing
import random
import re
import subprocess
import sys
#!/usr/bin/env python3
import argparse
import asyncio
import copy
import random
import re
from abc import ABC
from argparse import ArgumentParser
from asyncio import AbstractEventLoop, StreamReader, StreamWriter
#!/usr/bin/env python3
from __future__ import annotations
import functools
import itertools
import json
import multiprocessing
import random
import re
@DDoSolitary
DDoSolitary / nfa-determinization.cpp
Created November 9, 2021 16:04
NFA determinization
#include <utility>
#include <set>
#include <vector>
#include <optional>
#include <queue>
#include <map>
#include <iostream>
#include <iterator>
int main() {
@DDoSolitary
DDoSolitary / uwu-titan-helper.xml
Last active July 11, 2022 16:17
FFXIV UWU Titan Gaol Helper
<?xml version="1.0"?>
<TriggernometryExport Version="1">
<ExportedFolder Id="314a405e-6a9d-4740-bd57-fbdff3d50c50" Name="UWU_Titan" Enabled="true">
<Folders />
<Triggers>
<Trigger Enabled="true" Sequential="True" Name="Init" Id="149e2c1c-685d-46e7-b1da-4a8a91069fb7" RegularExpression=" ChangeMap .*:475:| ChatLog .*:UWU_Init$">
<Actions>
<Action OrderNumber="1" ListVariableName="UWU_JobOrder" TextAuraFontSize="9" TextAuraFontName="宋体" ActionType="ListVariable">
<Condition Enabled="false" Grouping="Or" />
</Action>