Skip to content

Instantly share code, notes, and snippets.

View cympfh's full-sized avatar
🏠
Working from home

/c/ympfh cympfh

🏠
Working from home
View GitHub Profile
import os
import openai
import streamlit
openai.api_key = os.getenv("OPENAI_API_KEY")
@streamlit.cache_resource
def chat(messages) -> dict:
tests/pll/aa
{"ok":true,"solution":{"algorithm":"U(SH)U(Sx)'(SH)'U(Sx)'U(Sx)'(SH)'","length":10}}
./target/release/cube -q --cfop < $f 0.02s user 0.00s system 99% cpu 0.020 total
tests/pll/ab
{"ok":true,"solution":{"algorithm":"(SH)(SH)(Sx)'(SH)","length":4}}
./target/release/cube -q --cfop < $f 0.00s user 0.00s system 94% cpu 0.003 total
tests/pll/e
{"ok":true,"solution":{"algorithm":"(Sx)'UU(SH)'UU(Sx)","length":7}}

Keybase proof

I hereby claim:

  • I am cympfh on github.
  • I am cympfh (https://keybase.io/cympfh) on keybase.
  • I have a public key whose fingerprint is BCF5 CACA 55D7 DE80 09D5 D3CE 5D17 76D9 ECD6 732E

To claim this, I am signing this object:

@cympfh
cympfh / katamari-reroll.asl
Created January 20, 2022 17:56
Original source code is available on https://www.speedrun.com/katamarireroll/resources . This script is patched for `start` and `reset`.
state("katamari")
{
byte levelID: "mono.dll", 0x0265110, 0x90, 0x10, 0x28, 0x408;
int frames: "mono.dll", 0x00265110, 0x90, 0x30, 0x20, 0x50, 0x51c;
float size: "PS2KatamariSimulation.dll", 0x16d77c;
int stage: "UnityPlayer.dll", 0x13FB8F8;
int newGameDialog: "UnityPlayer.dll", 0x0144F148, 0x14;
int newGameDialogValue: "mono.dll", 0x00268698, 0x190, 0x38, 0x268, 0xA40;
}
---
title: 2020/07/05 都知事選の確定投票率
result:
- name: 文京区
rate: 62.98
source: https://www.city.bunkyo.lg.jp/kusejoho/senkyo/r02tochiji/r2tochiji.html
- name: 豊島区
rate: 54.82
source: https://www.city.toshima.lg.jp/361/kuse/senkyo/2006191019.html
- name: 千代田区
@cympfh
cympfh / int64.awk
Last active January 16, 2020 18:16
64bit signed int
BEGIN {
E = 10000
}
function int64(x, _, i, xs, sign) {
if (substr(x, 1, 1) == "-") {
sign = -1
x = substr(x, 2, length(x) - 1)
} else {
sign = 1
}
#!/bin/bash
for i in $(seq 8000 8900); do
iptables -I INPUT 6 -p tcp -m tcp --dport $i -j ACCEPT
done
iptables -L --line-numbers
#!/bin/bash
BUILTIN_KBD_NAME="AT Translated Set 2 keyboard"
BLUETOOTH_KBD_NAME="HHKB-Hybrid_"
xinput set-prop "$BUILTIN_KBD_NAME" "Device Enabled" 1
trap "xinput set-prop '$BUILTIN_KBD_NAME' 'Device Enabled' 1; exit" 2
STATUS=none
#!/bin/bash
REGION_X=2928
REGION_Y=507
REGION_W=864
REGION_H=1220
WIN_MID_X=3200
WIN_MID_Y=1000
HASH_PREV=1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Speech-to-Text</title>
<script>
function echo(text) {
var style = 'color: #884488; font-weight: bold; font-size: 20px; \
text-shadow: #dddddd 2px 0px, #dddddd -2px 0px, #dddddd 0px -2px, \