blob: 9d4ccf081c7d72df407e42bd40f520b4e1edad89 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# Spark
### Sparklines for Your Shell
Here's a graph of your productivity gains after using `spark`: ▁▂▃▅▇
## Installation
Simply run `make` and `sudo make install`. The `DESTDIR` controls prefix, which is `/usr/local` by default.
## Usage
Just run `spark` and pass it a space deliminated list of numbers. 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`.
## Example
Magnitude of earthquakes over 1.0 in the last 24 hours:
$ curl -s http://earthquake.usgs.gov/earthquakes/catalogs/eqs1day-M1.txt | cut -d, -f9 | spark
▁▂▂▂▁▂▁▁▁▂▁▄▁▂▂▂▃▁▂▂▂▃▃▂▂▂▂▁▁▁▁▁▂▁▂▆▃▂▂▂▂▁▅▂▂▂▆▂▁▂▂▂▂▁▁▂▃▂▃▁▁▁▁▅▂▃▂▄▁▃▁▂▁▂▁▅▁▁▂▅▁▂▁▂▁▁▁▂▁▁▁▁▁▁▃▁▂
Number of commits in a git repo per active day:
$ git log --pretty=format:%ai --reverse | cut -d' ' -f1 | uniq -c | awk '{print $1}' | spark
▁▂▄▃▃▂▃▃▄▄▄▃▁▂▁▁▄▃█▃▂▂▅▄▄▃▂▄▃▇▄▂▄▁▁▂▅▂▂▁▂▁▂▂▄▅▃▂▃▂▂▂▂▄▂▂▁▄▂▁▂▂▃▂▂▂▁▂▂▂▄▂▃▃▆▅▂▂▄▅▃▁▂▁▁▂▁▂▂▄▁▁▂▃▂▂▄
Characters per line in spark.c:
$ awk '{ print length($0) }' spark.c | grep -Ev '^0$' | spark
▂▂▂▂▂▂▂▃▁█▆▆▂▁▂▂▃▃▂▂▄▂▂▂▁▃▃▃▂▃▂▁▂▂▂▂▂▂▄▂▂▂▁▂▂▂▇▂▂▂▂▂▁▂▂▃▂▅▂▃▂▁▁▃▃▃▃▃▂▁▂▁▁▃▂▂▃▃▂▂▇▁▂▂▂▁
|