• Stars
    star
    5,968
  • Rank 6,442 (Top 0.2 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 12 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

▁▂▃▅▂▇ in your shell.

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.

More Repositories

1

dotfiles

@holman does dotfiles
Shell
7,037
star
2

boom

Motherfucking TEXT SNIPPETS! On the COMMAND LINE!
Ruby
1,269
star
3

extended-exercise-windows

A list of startups that have employee-friendly terms for exercising your options past 90 days.
1,136
star
4

ama

Ask @holman anything!
722
star
5

left

Left is a clean, whitespace-happy layout for Jekyll.
CSS
536
star
6

spaceman-diff

diff images from the command line
Shell
464
star
7

gifme

Fucking animations. You need them.
Ruby
321
star
8

bubs

ⒷⓊⒷⒷⓁⒺⓈ
Ruby
178
star
9

bandwidth-friends

A shell script for macOS that makes sure you are being nice to your nice coffeeshop internet neighbors. 💖
Shell
87
star
10

boastful

A jQuery plugin to trawl Twitter for people linking to you.
JavaScript
82
star
11

hopper

Collection, Analyzation, and BBQing of Ruby community statistics.
Ruby
80
star
12

eponine

A very simple web server interface to shell scripts. Designed for Slack integrations on a Raspberry Pi.
Shell
54
star
13

rapinoe

Parse Keynote files in Ruby.
Ruby
46
star
14

stars

Recent Favstar and Convore stars on your command line.
Ruby
38
star
15

fuck-yeah

fuck yeah nouns
JavaScript
37
star
16

fatigue

Import your Nike+ runs into Garmin Connect.
Ruby
32
star
17

facelette

FACEEEEETIMMEMMEMEMEE
Ruby
28
star
18

this-machine-rebases-branches

it does.
26
star
19

vagranception

BWWWAAAAAAAAAAA
Ruby
22
star
20

tissues

things.app + github issues
Ruby
21
star
21

holmalicious

My mom sends me recipes.
19
star
22

git-hooks

Installable git hooks, a place to collect them
19
star
23

.js

holman's dotjs scripts
JavaScript
19
star
24

shamazing

SHAMAZING HASH ANALYSIS
Ruby
18
star
25

play

Play has moved to:
16
star
26

keep

It makes keeping config information pretty easy.
Ruby
12
star
27

casual

A tiny CAS client for Ruby.
Ruby
6
star
28

two_adium_one_cup

conversation history consolidation for Adium
Ruby
5
star
29

noted

A tiny Rails note search for your beautiful mug, sweetie.
5
star
30

maliciousurl

MALICIOUS MALICIOUS MALICIOUS MALICIOUS
Ruby
4
star
31

holman

holman
Ruby
4
star
32

brightkitey

brightkitey is a cute little Ruby wrapper around Brightkite's API.
Ruby
4
star
33

leftright

Cool replacement for Test::Unit's TestRunner
Ruby
1
star