Là một dự án mã nguồn mở, igrigorik/vimgolf đã đạt 778 sao trên GitHub, ngôn ngữ Ruby. Real Vim ninjas count every keystroke - do you?
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Real Vim ninjas count every keystroke - do you? Head on over to vimgolf.com, pick a challenge, and show us what you've got!
Each challenge provides an input file, and an output file
Your goal is to modify the input file such that it matches the output
Once you install the vimgolf CLI, pick a challenge, open a prompt and put away!
When you launch a challenge from the command line, it will be downloaded from the site and a local Vim session will be launched, which will log every keystroke you make. Once you're done, simply :wq (write and quit) the session and we will score your input and upload it back to the site!
Setup & Play
$> gem install vimgolf
(Go to vimgolf.com, sign in, and grab your API key)
$> vimgolf setup
(Pick a challenge on vimgolf.com)
$> vimgolf put [challenge ID]
Golfing without ruby installation: use docker
$> docker run --rm -it -e "key=YOUR_VIMGOLF_KEY" ghcr.io/filbranden/vimgolf challenge_ID
Playing from other editors
Emacs
There's a lightly maintained interface to play VimGolf challenges in Emacs
over at vimgolf.el
VimGolf.com web app
# start local server
$> bundle exec unicorn -c config/unicorn.rb -E development
# deploy to Heroku
$> git push heroku master
Run tests
Go to the root folder and run bundle exec rake.
How to contribute
This part is for people not familliar with ruby ecosystem
Installation
You need:
ruby
gem bundler
sqlite3 (library version 3.25 or newer, on your local system); or
postgresql
ruby
You need a ruby version, same as .ruby-version
I recommend using rbenv, see https://github.com/rbenv/rbenv to install and manage ruby version.
cd $VIMGOLF_PATH
rbenv install
bundler
Bundler is a gem that aim to manage gem per project.
gem install bundler:1.17.2
Then you need all gems for the apps
bundle install
Using sqlite3 for development (and testing)
It is possible to get a fully functionnal app running locally using SQLite3 only. This is the default adapter for development and testing (it makes for easier ramp up, since you don't need to set up an instance of Postgres and create the appropriate users.)
Note that due to the use of SQL window functions, you need an SQLite3 library version 3.25 or newer installed on your system. The Ruby gem will use the locally installed library, so that is a pre-requisite to using SQLite3. The SQLite3 library shipped on Ubuntu 18.04 is too old, the one on Ubuntu 20.04 is new enough.
Using Postgres for development
You can also use a Postgres database for development (and testing.)
Install and start a Postgres instance running locally on your development host.
The app will run under your user, so create a Postgres user with the same name as your local user and give that user the ability to create databases. This is usually accomplished with the following command:
sudo -u postgres createuser -d $(whoami)
When running any of the Ruby and Rails code, in order to use the Postgres adapter in the development and test environments, export environment variable DATABASE_ADAPTER=pg.
The database names configured will be vimgolf_development and vimgolf_test for the respective environments.
Seed database
Read db/seeds.rb to understand parameters to define how many users, challenges and entries to create.
When creating a local development database on SQLite3 (the default adapter), use the following procedure:
# make the index page works - create collection "challenges"
bundle exec rails db:drop db:setup
# or add many challenges users and entries
bundle exec rails db:drop db:setup challenges=40 users=30 entries=20
When creating a local development database on Postgres, do not use the db:setup and db:reset targets, as those targets rely on loading the db/schema.rb file, but that file contains a schema dump compatible with the SQLite3 database and would possibly produce a broken setup under Postgres. Instead, use db:migrate and db:migrate:reset to create the database running through the Rails migrations as appropriate.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/igrigorik/vimgolf là nguồn chính thức.
igrigorik/vimgolf có phải mã nguồn mở không?
Có — igrigorik/vimgolf phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/igrigorik/vimgolf.
igrigorik/vimgolf có trang demo không?
Dự án có trang chủ ở http://www.vimgolf.com/. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
igrigorik/vimgolf dùng license gì?
igrigorik/vimgolf phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
igrigorik/vimgolf là gì?
igrigorik/vimgolf (igrigorik/vimgolf) là dự án Ruby trên GitHub. Theo mô tả gốc: Real Vim ninjas count every keystroke - do you?
Đọc đầy đủ README ở tab phía trên.
vimgolf có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về vimgolf.