spark

▁▂▃▅▂▇ in your shell.

  • 所有者: holman/spark
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

spark

sparklines for your shell

See? Here's a graph of your productivity gains after using spark: ▁▂▃▅▇

install

spark is a shell script, so drop it somewhere and make sure it's added
to your $PATH. It's helpful if you have a super-neat collection of dotfiles,
like mine. Or you can use the following one-liner:

sudo sh -c "curl https://raw.githubusercontent.com/holman/spark/master/spark -o /usr/local/bin/spark && chmod +x /usr/local/bin/spark"

If you're on OS X, spark is also on Homebrew:

brew install spark

Depending on the fonts you have in your system and you use in the
terminal, you might end up with irregular blocks. This is due to some
fonts providing only part of the blocks, while the others are taken from
a different, fallback font.

usage

Just run spark and pass it a list of numbers (comma-delimited, spaces,
whatever you'd like). It's designed to be used in conjunction with other
scripts that can output in that format.

spark 0 30 55 80 33 150
▁▂▃▅▂▇

Invoke help with spark -h.

cooler usage

There's a lot of stuff you can do.

Number of commits to the github/github Git repository, by author:

› git shortlog -s, cut -f1, spark
  ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▃▁▁▁▁▁▁▁▁▂▁▁▅▁▂▁▁▁▂▁▁▁▁▁▁▁▁▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁

Magnitude of earthquakes worldwide 2.5 and above in the last 24 hours:

› curl -s https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.csv, sed '1d', cut -d, -f5, spark
▃█▅▅█▅▃▃▅█▃▃▁▅▅▃▃▅▁▁▃▃▃▃▃▅▃█▅▁▃▅▃█▃▁

Code visualization. The number of characters of spark itself, by line, ignoring empty lines:

› awk '{ print length($0) }' spark, grep -Ev 0, spark
  ▁▁▁▁▅▁▇▁▁▅▁▁▁▁▁▂▂▁▃▃▁▁▃▁▃▁▂▁▁▂▂▅▂▃▂▃▃▁▆▃▃▃▁▇▁▁▂▂▂▇▅▁▂▂▁▇▁▃▁▇▁▂▁▇▁▁▆▂▁▇▁▂▁▁▂▅▁▂▁▆▇▇▂▁▂▁▁▁▂▂▁▅▁▂▁▁▃▁▃▁▁▁▃▂▂▂▁▁▅▂▁▁▁▁▂▂▁▁▁▂▂

Since it's just a shell script, you could pop it in your prompt, too:

ruby-1.8.7-p334 in spark/ on master with history: ▂▅▇▂
›

wicked cool usage

Sounds like a wiki is a great place to collect all of your
wicked cool usage for spark.

contributing

Contributions welcome! Like seriously, I think contributions are real nifty.

Make your changes and be sure the tests all pass:

./test

That also means you should probably be adding your own tests as well as changing
the code. Wouldn't want to lose all your good work down the line, after all!

Once everything looks good, open a pull request.

▇▁ ⟦⟧ ▇▁

This is a @holman joint.

主要指標

概覽
名稱與所有者holman/spark
主編程語言Shell
編程語言Shell (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2011-11-15 02:51:39
推送於2022-05-07 10:27:15
最后一次提交2017-03-14 10:03:59
發布數2
最新版本名稱v1.0.1 (發布於 2013-01-10 16:28:59)
第一版名稱v1.0.0 (發布於 2011-12-01 21:23:20)
用户参与
星數6k
關注者數106
派生數291
提交數104
已啟用問題?
問題數46
打開的問題數9
拉請求數32
打開的拉請求數6
關閉的拉請求數26
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?