Skip to content

Instantly share code, notes, and snippets.

View mnixry's full-sized avatar
😴
Sleeping

Mix mnixry

😴
Sleeping
View GitHub Profile
// ==UserScript==
// @name Auto-Submitter (Multi-Page + 100 Batch Limit)
// @namespace Violentmonkey Scripts
// @match https://match.ichunqiu.com/index*
// @version 1.3
// @author -
// @description Fetches 5 pages, dedupes, and submits in batches of 100 flags per request
// @grant GM_xmlhttpRequest
// ==/UserScript==
@mnixry
mnixry / anylink.Dockerfile
Last active November 11, 2025 17:50
A more ergonomic AnyLink (https://github.com/bjdgyc/anylink) build Dockerfile.
@mnixry
mnixry / printlog.c
Created November 4, 2025 04:32
Expose Wemeet Linux version internal logs
// Usage:
// gcc ./printlog.c -shared -o libwemeet_log_override.so -fPIC -Wall -Wextra
// export LD_PRELOAD=$(realpath ./libwemeet_log_override.so)
#include <execinfo.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct {
const char *ptr;
@mnixry
mnixry / linux-cross-build-rust.nix
Created October 17, 2025 13:15
Nix snippet for cross build rust binaries to windows-gnu, linux-musl and apple-darwin.
{
lib,
pkgs,
crane,
zig_0_13,
cargo-zigbuild,
target,
rev,
}:
let
@mnixry
mnixry / replace_space_to_underscore.py
Created September 21, 2025 14:26
Replace space in string to underscore w/ x86_64 shellcode in Python.
import ctypes
import mmap
def replace_space_to_underscore(input_: str):
assert input_.isascii()
buf = ctypes.create_string_buffer(input_.encode())
shellcode = (
b"\x48\xbf"
+ ctypes.addressof(buf).to_bytes(8, "little")
@mnixry
mnixry / crontab-guru.ts
Created June 26, 2025 16:24
crontab.guru style cron syntax parser and generates explanation.
class CronTabParsingError extends Error {
static assert(condition: unknown, message: string): asserts condition {
if (!condition) {
throw new CronTabParsingError(message);
}
}
}
const ordinal = (n: number): string => {
if (n % 100 >= 11 && n % 100 <= 13) return `${n}th`;
import { cn } from "@/utils";
export const ProgressiveBlurBackground: React.FC<
React.ComponentProps<"div"> & {
orientation?: "top" | "bottom";
steps?: number;
blurTargetPx?: number;
}
> = ({
className,
@mnixry
mnixry / zon.py
Created May 24, 2025 17:45
A loose ZON (Zig Object Notation) parser in pure Python.
from typing import final
import parsy as p
whitespace = p.regex(r"\s*")
comment = p.regex(r"//.*")
def lexeme(parser: p.Parser):
return parser << (whitespace | comment)
@mnixry
mnixry / udpchk.py
Created May 23, 2025 14:14
Simple tool to test UDP support of SOCKS5 proxy.
# udpchk.py - simple tool to test UDP support of SOCKS5 proxy.
# Copyright (C) 2016-2017 Zhuofei Wang <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@mnixry
mnixry / loading-button.tsx
Last active April 28, 2025 00:33
Loading & Refresh Button component for Shadcn UI & Lucide Icons.
import { useCallback, useState } from 'react';
import { Loader2Icon } from 'lucide-react';
import { useInterval } from 'react-use';
import { cn } from '@/lib/utils';
import { Button } from '@/components/ui/button';
export const LoadingButtonPrimitive: React.FC<
React.ComponentPropsWithRef<typeof Button> & { loading?: boolean }
> = ({ loading, disabled, className, children, ...props }) => {