Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,44 @@
# spark
### sparklines for your shell
## Sparklines

[Sparklines](http://en.wikipedia.org/wiki/Sparkline) are small in-line infographics
which sum up a data-series ([examples](http://commons.wikimedia.org/wiki/Category:Sparkline)).
They don't take up as much space as a full-blown graphic and so you can use them all over.
But classic [Edward Tufte](http://en.wikipedia.org/wiki/Edward_Tufte)-style
sparklines are hard to make - you either need to be an artist or know a library or
complicated tool.

Why not have simpler [Twitter](http://kottke.org/11/05/twitter-sparklines)-style sparklines,
drawn with some handy-dandy Unicode characters?

## Sparklines for your shell

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

## install
### install

spark is a [shell script][bin], 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][dotfiles].

## usage
### 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
> spark 0 30 55 80 33 150
▁▂▃▅▂▇

Invoke help with `spark -h`.

## cooler usage
### cooler usage

There's a lot of stuff you can do.

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

```bash
```sh
› git shortlog -s |
cut -f1 |
tr "\n" ',' |
Expand All @@ -37,7 +49,7 @@ Number of commits to the github/github Git repository, by author:

Magnitude of earthquakes over 1.0 in the last 24 hours:

```bash
```sh
› curl http://earthquake.usgs.gov/earthquakes/catalogs/eqs1day-M1.txt --silent |
sed '1d' |
cut -d, -f9 |
Expand All @@ -49,7 +61,7 @@ Magnitude of earthquakes over 1.0 in the last 24 hours:

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

```bash
```sh
› awk '{ print length($0) }' spark |
grep -Ev 0 |
tr "\n" ',' |
Expand All @@ -64,12 +76,12 @@ ruby-1.8.7-p334 in spark/ on master with history: ▂▅▇▂
```

## wicked cool usage
### wicked cool usage

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

## todo
### todo

so hint hint hint if you're looking for something to hack on.

Expand Down