Skip to content

Instantly share code, notes, and snippets.

@got4416
got4416 / the-lifecycle-of-the-status-of-your-files.md
Last active November 30, 2025 13:43
The lifecycle of the status of your files
---
title: The lifecycle of the status of your files (Extended)
---
stateDiagram-v2
  workingtree_untracked : Working Tree<br>Untracked
  workingtree_deleted : Working Tree<br>Deleted
  index_new_file : Index<br>New file
  workingtree_modified : Working Tree<br>Modified  
  index_modified : Index<br>Modified
@got4416
got4416 / volta-shim-setup.cmd
Last active September 12, 2025 10:33
Shim settings required for installation in volta-windows-zip (verified in v2.0.2)
@echo off
pushd "%~dp0"
set VOLTA_SHIM_EXE=volta-shim.exe
set SHIM_BINARY=node,npm,npx,pnpm,yarn,yarnpkg
set SHIM_SCRIPT=npm,npx,pnpm,yarn,yarnpkg
if not exist %VOLTA_SHIM_EXE% (
echo ERROR %VOLTA_SHIM_EXE% not found!
echo.
pause
exit /b 1
@got4416
got4416 / xuint.py
Created February 8, 2018 17:35
Test-Driven Development By Example - 第22章 失敗の扱い
class TestResult:
def __init__(self):
self.runCount = 0
self.errorCount = 0
def testStarted(self):
self.runCount = self.runCount + 1
def testFailed(self):
self.errorCount = self.errorCount + 1
def summary(self):
return "%d run, %d failed" % (self.runCount, self.errorCount)