Skip to content

Instantly share code, notes, and snippets.

View kazuki0824's full-sized avatar
👋
I may be slow to respond.

maleicacid kazuki0824

👋
I may be slow to respond.
View GitHub Profile
@kazuki0824
kazuki0824 / Windows.dockerfile
Last active August 19, 2023 18:27
WindowsでRustのビルドを行う(msvc, gnu両対応?)
ARG IMAGE=mcr.microsoft.com/dotnet/framework/runtime:4.8.1
FROM ${IMAGE}
SHELL ["powershell", "-command"]
RUN Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointsManager]::ServerCertificationCallback = {$true}; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
RUN choco install cmake -y --installargs 'ADD_CMAKE_TO_PATH=System'
RUN choco install mingw visualstudio2022buildtools -y
RUN choco install rustup.install llvm -y
RUN rustup default stable-gnu
@kazuki0824
kazuki0824 / example_parser.py
Created September 20, 2023 15:00
PyParsingとChatGPTを用いたパーサーコンビネータ入門
"""
与えたプロンプト
論理式のパーサーをpyparsingで作りたい。要件は以下の通り。
1. 各項目名はダブルクォーテーションで囲まれる。例 "anthurium"
2. ダブルクォーテーション自体を含む場合、それは2つのダブルクォーテーションとして表現される。例 "forget""me ""not"
3. 各項目の手前に!を置くことで「否定」を表現できる。例 !"rose"
4. 各項目を&演算子で繋げることができる。つまり"anthurium"&!"dandelion"|"rose"
5. 丸いカッコ()を用いて演算順序の表現ができるようにする。例 !"anthurium" & ((!"dandelion"| "rose") & "sunflower")

Windows でPythonをセットアップする手順

1. Windowsマシンを用意

あらかじめ、Windows環境を準備します。

2. Powershellスクリプトの実行を許可

  1. Powershellを「管理者権限で実行」します。
  2. 次のコマンドを実行し、Powershellスクリプトの実行を許可します:
@kazuki0824
kazuki0824 / gist:a66480e1aac272191a543b0f5c9df553
Created May 1, 2025 09:29
Proxmox セットアップ手順
aptリポジトリを無料版に書き換え
apt update
apt install git build-essential curl wget nano -y
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
-y \
--default-toolchain nightly \
--target wasm32-unknown-emscripten
. "$HOME/.cargo/env"