Skip to content

Instantly share code, notes, and snippets.

View terasakisatoshi's full-sized avatar

Satoshi Terasaki terasakisatoshi

View GitHub Profile
@terasakisatoshi
terasakisatoshi / html_css_javascript.jl
Last active May 24, 2025 00:36
MonacoEditor CSS JavaScript editor
### A Pluto.jl notebook ###
# v0.20.6
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
#! format: off
return quote
@terasakisatoshi
terasakisatoshi / hack.jl
Last active May 23, 2025 00:50
全パッケージ事前翻訳プロジェクト
# @doc Mod.obj を事前に実行することで翻訳をキャッシュする
using DotEnv; DotEnv.load!()
using DocstringTranslation
import ProgressMeter
lang = ARGS[1]
@info lang
@switchlang! lang
using Pkg
@terasakisatoshi
terasakisatoshi / cache.jl
Last active June 2, 2025 11:07
個人でJuliaのdocstring/マニュアルを日本語翻訳にする方法
#=
概要: docstring を日本語(:ja) に翻訳する
使い方: 事前にOpenAI API Key を取得してその値を環境変数 OPENAI_API_KEY をセットしておくこと
このスクリプトを cache.jl とすれば下記のように実行する
julia -t 64 cache.jl
下記のディレクトリに翻訳結果が溜まっていく.
機械翻訳に不満があれば対応する ja.md を修正すれば良い.
@terasakisatoshi
terasakisatoshi / main.jl
Last active April 19, 2025 07:33
モスバーガーのSTLふぁいる可視化
import MeshIO
using FileIO
using GLMakie
function main()
buns01 = load("buns01.stl")
patty = load("patty.stl")
lettuce = load("lettuce.stl")
tomato = load("tomato.stl")
buns02 = load("buns02.stl")
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width" />
<meta charset="utf-8" />
<meta name="pluto-insertion-spot-meta">
@terasakisatoshi
terasakisatoshi / calcpi.html
Created March 1, 2025 06:02
Calling Go functions from Julia
<!DOCTYPE html><html lang="en"><head><meta name="viewport" content="width=device-width"><meta charset="utf-8">
<meta name="pluto-insertion-spot-meta">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="white"><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#2a2928"><meta name="color-scheme" content="light dark"><link rel="icon" type="image/png" sizes="16x16" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/favicon-16x16.267aebbe.png"><link rel="icon" type="image/png" sizes="32x32" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/favicon-32x32.1b9d3e70.png"><link rel="icon" type="image/png" sizes="96x96" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/favicon-96x96.26e08763.png"><link rel="pluto-external-source" id="pluto-logo-big" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/logo.49a14041.svg"><link rel="pluto-external-source" id="pluto-logo-small" href="https://cdn.jsdelivr.net
@terasakisatoshi
terasakisatoshi / go.html
Created March 1, 2025 02:05
Here we go
<!DOCTYPE html><html lang="en"><head><meta name="viewport" content="width=device-width"><meta charset="utf-8">
<meta name="pluto-insertion-spot-meta">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="white"><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#2a2928"><meta name="color-scheme" content="light dark"><link rel="icon" type="image/png" sizes="16x16" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/favicon-16x16.267aebbe.png"><link rel="icon" type="image/png" sizes="32x32" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/favicon-32x32.1b9d3e70.png"><link rel="icon" type="image/png" sizes="96x96" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/favicon-96x96.26e08763.png"><link rel="pluto-external-source" id="pluto-logo-big" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/logo.49a14041.svg"><link rel="pluto-external-source" id="pluto-logo-small" href="https://cdn.jsdelivr.net
@terasakisatoshi
terasakisatoshi / rust_script.html
Last active March 1, 2025 01:41
How to run Rust as a script
<!DOCTYPE html><html lang="en"><head><meta name="viewport" content="width=device-width"><meta charset="utf-8">
<meta name="pluto-insertion-spot-meta">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="white"><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#2a2928"><meta name="color-scheme" content="light dark"><link rel="icon" type="image/png" sizes="16x16" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/favicon-16x16.267aebbe.png"><link rel="icon" type="image/png" sizes="32x32" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/favicon-32x32.1b9d3e70.png"><link rel="icon" type="image/png" sizes="96x96" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/favicon-96x96.26e08763.png"><link rel="pluto-external-source" id="pluto-logo-big" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/logo.49a14041.svg"><link rel="pluto-external-source" id="pluto-logo-small" href="https://cdn.jsdelivr.net
@terasakisatoshi
terasakisatoshi / main.jl
Created February 2, 2025 04:36
task in the while loop
function main()
c = 0
while true
c += 1
@info "c" c
t = @async begin
try
sleep(1)
if c >= 5
@show x
@terasakisatoshi
terasakisatoshi / tmux.conf
Created January 19, 2025 01:24
tmux.conf
set -g prefix C-t
unbind C-b
set-option -g mouse on
bind h split-window -h
bind v split-window -b