Skip to content

Instantly share code, notes, and snippets.

use core::{mem::MaybeUninit, slice, str};
const HEX_DIGITS_LUT: &[u8] = b"0123456789ABCDEF";
const MAX_LEN: usize = 20;
pub struct Buffer([MaybeUninit<u8>; MAX_LEN]);
impl Buffer {
#[inline]
@kekeimiku
kekeimiku / wl-copy.el
Created April 25, 2021 01:24
emacs use wl-copy
(setq wl-copy-process nil)
(defun wl-copy (text)
(setq wl-copy-process (make-process :name "wl-copy"
:buffer nil
:command '("wl-copy" "-f" "-n")
:connection-type 'pipe))
(process-send-string wl-copy-process text)
(process-send-eof wl-copy-process))
(defun wl-paste ()
(if (and wl-copy-process (process-live-p wl-copy-process)) nil
@kekeimiku
kekeimiku / mysql
Last active January 18, 2024 15:36
Dbeaver connect to docker database unable to export and import temporary solutions. mysql/postgres
#!/bin/sh
docker exec -i mysql /usr/bin/mysql $@ -p2325373912
@kekeimiku
kekeimiku / rust-helloworld.rs
Last active March 26, 2022 07:27
The tiny rust-x64-helloworld experiment
#![no_std]
#![no_main]
use core::arch::asm;
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {}
}