Skip to content

Instantly share code, notes, and snippets.

@Saharayama
Saharayama / pp.md
Last active November 4, 2025 14:46

usage example

$ pp "24"
24
0x18
0b11000
0b1_1000 (5)
$ pp "0x18"
24
0x18
@Saharayama
Saharayama / keymap.json
Created October 19, 2025 05:59
zed settings
// Zed keymap
//
// For information on binding keys, see the Zed
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: open default keymap`
// from the command palette.
[
{
"context": "Workspace",
static void iica0_masterhandler(void)
{
/* Detection of stop condition handling */
if ((0U == IICBSY0) && (g_iica0_tx_cnt != 0U))
{
/* 送信途中でバスがアイドル状態(STOP条件検出)になった場合 */
r_iica0_callback_master_error(MD_SPT);
}
else
{
package main
import (
"fmt"
"os"
"os/exec"
)
const (
gitBashPath = `C:\Program Files\Git\git-bash.exe`
@Saharayama
Saharayama / tasks.json
Last active August 5, 2025 13:39
task.json (uv nuitka)
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "Dafault build",
"command": "uv",
"args": [
"run",
"python",
@Saharayama
Saharayama / .gitignore
Last active October 26, 2025 06:49
marpのsample
*.pdf
/.vscode/
*.html
"\C-xb": "\eb\"\ef\""
"\C-xn": "\eb'\ef'"
package main
import (
"database/sql"
"fmt"
"log"
_ "github.com/go-sql-driver/mysql"
)
import urllib.request
from html.parser import HTMLParser
class TitleParser(HTMLParser):
def __init__(self):
super().__init__()
self.title = ""
self.in_title = False
import glob
from natsort import natsorted
import sys
sys.stdout.reconfigure(encoding="utf-8")
def extract_content_below_keywords(file_paths, keywords):
"""
複数の Shift-JIS テキストファイルを読み込み、複数のキーワードそれぞれについて、
マッチする行の1行下の内容を抽出する。