Step-by-step guide for building the Claude Code CLI from the alesha-pro/claude-code repository — leaked Anthropic Claude Code source code.
- Linux (Ubuntu 22.04+) or macOS
- 4GB RAM, 4 CPU cores, 30GB disk
- Bun >= 1.3
- Git
Step-by-step guide for building the Claude Code CLI from the alesha-pro/claude-code repository — leaked Anthropic Claude Code source code.
| {# | |
| Qwen3.5-compatible relaxed chat template | |
| Purpose: | |
| - allow multiple system messages | |
| - treat developer messages like system messages | |
| - merge all leading/interleaved system/developer messages into one system block | |
| - avoid "System message must be at the beginning" | |
| #} | |
| {%- set ns = namespace( |
Everytime a large language model makes predictions, all of the thousands of tokens in the vocabulary are assigned some degree of probability, from almost 0%, to almost 100%. There are different ways you can decide to choose from those predictions. This process is known as "sampling", and there are various strategies you can use which I will cover here.
One of the headaches I have been bugged by is domain knowledge in SQL queries when it comes to configure code base with Onion Architecture.
If you want to filter data, it is not realistic to use Array.filter to filter the data after retrieving it by SQL, as it consumes memory and is bad for performance.
I have no choice but to write the filter conditions in the WHERE clause of SQL, but I thought it might be a good idea to define the conditions in the WHERE clause as constants in the domain layer.
| ffmpeg -i movie.mp4 -r 1/2 ./frame_%04d.jpg |
| #!/bin/sh | |
| # 使い方 | |
| # cut.sh 開始時間 終了時間 元のファイル | |
| # | |
| # 例) 1時間32分15秒から、1時間34分5秒まで切り取る | |
| # cut.sh 1:32:15 1:34:05 input.mp4 | |
| ffmpeg -ss $1 -to $2 -i "$3" -vf fade=d=1.0,reverse,fade=d=1.0,reverse -af afade=d=1.0,areverse,afade=d=1.0,areverse -c:a aac output.mp4 |
| # 使い方 | |
| # $ python batch_stitching.py -i 画像のあるディレクトリ | |
| # | |
| # 結合する画像は重なっている部分が必要です。 | |
| # 画像の天地は揃えたほうがよいです。縦横が違うとズレが出ます。 | |
| # opencv-contrib-pythonとimutilsを別途インストールする必要があります。 | |
| import os | |
| import functools | |
| import argparse |
| モデル | 対角 | 横 | 縦 |
|---|---|---|---|
| iPhone12 mini | 137.16mm | 57.6mm | 124.8mm |
| iPhone12 | 159.94mm | 67mm | 145.2mm |
| iPhone12 Pro | 159.94mm | 67mm | 145.2mm |
| iPhone12 Pro Max | 170.18mm | 71.5mm | 154.9mm |
| #!/bin/sh | |
| # こちらのブログを参考にしました https://dafuku2.blogspot.com/2019/09/macos.html | |
| # TimeMachineが使っている分しか消せないので、パージ可能領域は完全になくなりません。 | |
| # 結構時間がかかります。 | |
| tmutil listlocalsnapshots / | rg -e '\d{4}-\d{2}-\d{2}-\d{6}' -o | xargs -I date tmutil deletelocalsnapshots date |