Skip to content

Instantly share code, notes, and snippets.

@rmb122
rmb122 / quicksort.py
Created October 9, 2022 17:14
python quicksort
import copy
import random
import time
import typing
def lomuto_quicksort(arr: typing.List[int]):
if len(arr) <= 1:
return
@rmb122
rmb122 / php_memory_shell.php
Last active October 3, 2022 07:10
php_memory_shell.php
<?php
class FCGIClient {
const VERSION_1 = 1;
const BEGIN_REQUEST = 1;
const ABORT_REQUEST = 2;
const END_REQUEST = 3;
const PARAMS = 4;
const STDIN = 5;
const STDOUT = 6;
@rmb122
rmb122 / hook_vte.c
Last active June 11, 2022 00:55
hook_vte.c
#define _GNU_SOURCE
#include <stdlib.h>
#include <dlfcn.h>
typedef unsigned int gsize;
typedef double gdouble;
typedef struct {
gdouble red;
@rmb122
rmb122 / ipv6wry.go
Created January 15, 2022 14:40
ipv6wry go version
package main
import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"net"
"os"
)
@rmb122
rmb122 / fuck_god_damn_it_node_modules.py
Created January 25, 2021 12:38
Fuck god damn it node_modules
import os
import typing
import shutil
def walk_dirs(path: str, cb: typing.Callable, skip_dot: bool) -> None:
try:
entries = os.listdir(path)
except PermissionError:
return