Skip to content

Instantly share code, notes, and snippets.

NyaMisty / chinese_checker.xml
Created April 15, 2024 11:11
Overleaf Copilot 中文语法检查器
<agent name="中文 Checker">
<icon mdi="text-search-variant" />
<model temperature="0.7">gpt-3.5-turbo-16k</model>
<join-diff format="html">
<diff unit="char"> <!-- 必须是char,因为word模式没法匹配 -->
<input />
NyaMisty / phpbb_concat.go
Created March 25, 2024 18:43
phpbb concat
package main
import (
NyaMisty /
Created February 23, 2024 14:36
Recursively mount ZFS snapshot for a dataset
# Change these parameters
datasets=($(zfs list -t filesystem -H | cut -d$'\t' -f1 | grep -E '^'$dataset_name'(/|$)'))
echo "Datasets selected: ${datasets[@]}"
for d in "${datasets[@]}"; do
NyaMisty / damage.c
Last active January 26, 2024 08:37
Evol deepspace damage calculation
// local variable allocation has failed, the output may be wrong!
__int64 __fastcall DamageFormula__CalcDamage(
DamageInfo **damageInfo,
void *damageExporter,
Actor *damageTaker,
Actor *assistor,
HitParamConfig *hitParamConfig,
float hurtAddAngle,
float damageProportion,
char isCritical,
NyaMisty /
Last active January 26, 2024 03:44
A small snippet to use CoCoPilot without patching Copilot plugin


Turn cocopilot into github enterprise server, so that we can use CoCoPilot without patching Copilot plugin.


  1. Add the following JS to a cloudflare worker.
  2. Add Cloudflare Worker Routes: *cocopilot-gh-enterprise.XXXXXXXX.XXX. You should also add DNS records cocopilot-gh-enterprise.XXXXXXXX.XXX & *.cocopilot-gh-enterprise.XXXXXXXX.XXX to make the route available image
  3. Setting GitHub Enterprise URL to cocopilot-gh-enterprise.XXXXXXXX.XXX
const url = $request.url
var new_hdrs = {}
for (var k in $request.headers) {
new_hdrs[k.toLowerCase()] = $request.headers[k]
function main() {
if (url == '') {
if (!($request.body.includes('mfa_code') && $request.body.includes('mfa_token'))) {
NyaMisty /
Created August 5, 2023 12:47
Python fileobj from HTTP, with ranged request!
import io
import requests
class HTTPFileObj:
def __init__(self, url, chunk_size=1024):
self.url = url
self.chunk_size = chunk_size
self.start_byte = 0 # Initialize start_byte here
self.buffer = b"" # Initialize buffer to store remaining data
self.max_size = -1
NyaMisty /
Created June 8, 2023 18:59
Login additional account on MacOS
#import <Foundation/Foundation.h>
@interface AMSBag : NSObject {}
+(id)bagForProfile:(id)arg1 profileVersion:(id)arg2 ;
+(id)bagForProfile:(id)arg1 profileVersion:(id)arg2 processInfo:(id)arg3 ;
-(NSString *)URLForKey:(NSString *)key;
@interface ACAccount : NSObject {}
NyaMisty /
Last active February 22, 2023 20:51
Ghidra Script: Remap Ctrl&Meta to platform Ctrl key (i.e. Command on macOS, Ctrl on Win/Linux). Note: because Ghidra does not support running script on startup, you'll need to run this script manually on ech start :(
# Remap Ctrl&Meta to platform Ctrl key (i.e. Command on macOS, Ctrl on Win/Linux)
#@author NyaMisty
#@category UIHelper
#@keybinding Alt-C
#@menupath Edit.RemapCtrl
#@toolbar RemapCtrl
from javax.swing import KeyStroke
from java.awt.event import InputEvent
NyaMisty /
Last active March 14, 2023 15:15
Misty's Ghidra IDA like experience

How to Use

  1. In Ghidra's Project Tool, Go to Tools -> Import Tool..., select mistyCodeBrowser.tool
  2. Dragging file onto the new CodeBrowser_1 in ToolChest