Skip to content

Instantly share code, notes, and snippets.

View kanaihiroki's full-sized avatar

Kanai Hiroki kanaihiroki

  • Tokyo
View GitHub Profile
@kanaihiroki
kanaihiroki / gist:9643f880de53231ffdaa2b6dbad556f2
Created April 27, 2026 14:41
Ten-Four ポーカーのハンド履歴をテキスト形式でクリップボードにコピーするTampermonkey Script
// ==UserScript==
// @name Ten-Four Hand Exporter
// @namespace https://tenfour-poker.com/
// @version 1.0.0
// @description Ten-Four ポーカーのハンド履歴をテキスト形式でクリップボードにコピー
// @match https://tenfour-poker.com/*
// @grant GM_setClipboard
// @run-at document-idle
// ==/UserScript==
@kanaihiroki
kanaihiroki / brainfuck.c
Created February 3, 2025 14:55
brainfuck.c
/* compile: gcc -O3 -pedantic-errors -Wextra -std=c89 brainfuck.c -o brainfuck */
#include <stdio.h>
#define MAX_CODE_LEN 64000
static int ip = -1; /* instruction pointer */
static int dp = 0; /* data pointer */
static char data[30000];
static char code[MAX_CODE_LEN];
@kanaihiroki
kanaihiroki / encfile
Created December 31, 2024 17:38
simple file encryption
#!/bin/bash
PASS='<password>'
openssl enc -aes256 -pbkdf2 -md sha-512 --pass pass::$PASS -nosalt -in - -out -
# decrypt
openssl enc -d -aes256 -pbkdf2 -md sha-512 --pass pass::$PASS -nosalt -in - -out -
@kanaihiroki
kanaihiroki / kill-region-to-x11.el
Created January 2, 2019 06:28
copy to x11 clipboard when region killed (using xsel)
(setq interprogram-cut-function
(lambda (s)
(let ((f (make-temp-file "clip")))
(append-to-file s nil f)
(call-process "xsel" f nil nil)
(delete-file f))))