This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
import { nip19, getPublicKey } from 'nostr-tools' | |
// secp256k1 curve order | |
const n = 115792089237316195423570985008687907852837564279074904382605163141518161494337n | |
// Get nsec from command line argument | |
const input_nsec = process.argv[2] | |
// Check arguments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { nip19, getPublicKey } from 'nostr-tools' | |
import crypto from 'crypto' | |
// secp256k1の位数 | |
const n = 115792089237316195423570985008687907852837564279074904382605163141518161494337n | |
// シードから秘密鍵ペアを生成 | |
function generatePair(seed) { | |
// シードをSHA256でハッシュ化して32バイトの値を作る | |
const hash = crypto.createHash('sha256').update(seed).digest() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import os | |
import csv | |
import shutil | |
from datetime import datetime | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import matplotlib.dates as mdates | |
# Save current branch name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Find the root of the git repository | |
git_root=$(git rev-parse --show-toplevel 2>/dev/null) | |
if [ $? -ne 0 ]; then | |
echo "Error: Not in a git repository" | |
exit 1 | |
fi | |
# Check if we're in a submodule |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' 正しいかは分かりませんが… | |
' References: | |
' https://github.com/Blockstream/Jade/blob/master/main/process/pinclient.c | |
' https://github.com/Blockstream/blind_pin_server | |
' https://help.blockstream.com/hc/en-us/articles/9639949755673-How-does-Blockstream-Jade-s-oracle-enforced-PIN-protection-work | |
' https://help.blockstream.com/hc/en-us/articles/15884462476953-Blockstream-Jade-Security-Model-FAQs | |
@startuml | |
participant "ユーザー" as U | |
participant "Jade\n(ハードウェアウォレット)" as HW |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sudo apt install fzf | |
export DIR_HIST_FILE="$HOME/.dir_history" | |
function d { | |
if [[ ! -f "$DIR_HIST_FILE" ]]; then | |
touch "$DIR_HIST_FILE" | |
fi | |
if [[ -z "$1" ]]; then | |
selected=$(tac "$DIR_HIST_FILE" | fzf --height 40% --reverse --prompt="Select directory: ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sudo apt install wslu | |
# install and login to gh https://docs.github.com/github-cli/github-cli/about-github-cli | |
alias waitdeploy='wslview $(gh run list --repo koteitan/koteitan.github.io --limit 1 --json url -q ".[0].url")' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <X11/Xlib.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
// 瞳の座標を計算する関数 | |
void calculate_pupil_position(int eye_x, int eye_y, int eye_radius, int mouse_x, int mouse_y, int *pupil_x, int *pupil_y) { | |
double dx = mouse_x - eye_x; | |
double dy = mouse_y - eye_y; | |
double distance = sqrt(dx * dx + dy * dy); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! SilentMake() | |
write | |
cclose | |
let l:make_output = system('make') | |
if v:shell_error != 0 | |
cgetexpr l:make_output | |
cwindow | |
wincmd p |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# OpenAI APIキーを環境変数から取得 | |
API_KEY="$OPENAI_API_KEY" | |
# APIキーが設定されているか確認 | |
if [ -z "$API_KEY" ]; then | |
echo "Error: OPENAI_API_KEY is not set. Please set your OpenAI API key." | |
exit 1 | |
fi |
NewerOlder