Vim Snake 2.0 is written in Go and compiled to Web Assembly.
I originally built this site in 2013 using my extremely limited knowledge of javascript and ruby/sinatra. It was trivial to cheat and so the leaderboard was meaningless. This rewrite fixes those issues and taught me a bunch about new web technologies.
go run cmd/main.go serve
or to watch use the reflex
golang package
reflex -r '\.go$' -s -- sh -c "go run cmd/main.go serve"
Create a .env file with environment variables shown in .env_example
yarn build
single build or yarn start
for development
NOTE: wasm_exec.js needs to be from the specific go version
make
to build (also watched and built by yarn start
)
Build docker build . -t vimsnake:latest --build-arg ARCH=arm64
Run docker run -p 3000:8090 --rm -it vimsnake
Inspect docker run --rm -it -p 3000:8090 --entrypoint sh vimsnake:latest
- Show your top score and thumbnail
- When generating migrations, generate a test file too
- When making fields required, set default value and enforce at DB level