Wednesday, May 11, 2016

Text-based Calendar and Weather in Terminal

Having a little fun in the terminal thanks to an HN post discussing a post on cal from adriansieber.com.

First off, cal- remember it's a four digit year:

$ cal 2016
                             2016

      January               February               March
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
                1  2      1  2  3  4  5  6         1  2  3  4  5
 3  4  5  6  7  8  9   7  8  9 10 11 12 13   6  7  8  9 10 11 12
10 11 12 13 14 15 16  14 15 16 17 18 19 20  13 14 15 16 17 18 19
17 18 19 20 21 22 23  21 22 23 24 25 26 27  20 21 22 23 24 25 26
24 25 26 27 28 29 30  28 29                 27 28 29 30 31
31                                          
       April                  May                   June
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
                1  2   1  2  3  4  5  6  7            1  2  3  4
 3  4  5  6  7  8  9   8  9 10 11 12 13 14   5  6  7  8  9 10 11
10 11 12 13 14 15 16  15 16 17 18 19 20 21  12 13 14 15 16 17 18
17 18 19 20 21 22 23  22 23 24 25 26 27 28  19 20 21 22 23 24 25
24 25 26 27 28 29 30  29 30 31              26 27 28 29 30
                                            
        July                 August              September
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
                1  2      1  2  3  4  5  6               1  2  3
 3  4  5  6  7  8  9   7  8  9 10 11 12 13   4  5  6  7  8  9 10
10 11 12 13 14 15 16  14 15 16 17 18 19 20  11 12 13 14 15 16 17
17 18 19 20 21 22 23  21 22 23 24 25 26 27  18 19 20 21 22 23 24
24 25 26 27 28 29 30  28 29 30 31           25 26 27 28 29 30
31                                          
      October               November              December
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
                   1         1  2  3  4  5               1  2  3
 2  3  4  5  6  7  8   6  7  8  9 10 11 12   4  5  6  7  8  9 10
 9 10 11 12 13 14 15  13 14 15 16 17 18 19  11 12 13 14 15 16 17
16 17 18 19 20 21 22  20 21 22 23 24 25 26  18 19 20 21 22 23 24
23 24 25 26 27 28 29  27 28 29 30           25 26 27 28 29 30 31
30 31   

Another fun fact, courtesy of JoshTriplett:

$ cal 9 1752
   September 1752
Su Mo Tu We Th Fr Sa
       1  2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30




jaybosamiya shared the reason for this.

More on cal in the linked post.

Another neat command is really curling a service for weather (mentioned by wyc). Here's the weather in Washington, D.C. on the night of 5/11/2016, just to see how cold it is up there:

$ curl wttr.in/20001
Weather for Zipcode: 20001

               Overcast 
      .--.     59 °F          
   .-(    ).   ↓ 0 mph        
  (___.__)__)  8 mi           
               0.0 in         
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Wed 11. May ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│               Overcast       │      .-.      Light drizzle  │      .-.      Light drizzle  │               Mist           │
│      .--.     55 – 57 °F     │     (   ).    62 – 64 °F     │     (   ).    64 – 66 °F     │  _ - _ - _ -  60 °F          │
│   .-(    ).   ← 4 – 6 mph    │    (___(__)   ↙ 4 – 5 mph    │    (___(__)   ↙ 3 – 4 mph    │   _ - _ - _   ↙ 3 – 5 mph    │
│  (___.__)__)  6 mi           │     ‘ ‘ ‘ ‘   1 mi           │     ‘ ‘ ‘ ‘   1 mi           │  _ - _ - _ -  1 mi           │
│               0.0 in | 18%   │    ‘ ‘ ‘ ‘    0.0 in | 10%   │    ‘ ‘ ‘ ‘    0.0 in | 35%   │               0.0 in | 3%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Thu 12. May ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│               Overcast       │  _`/"".-.     Light rain sho…│  _`/"".-.     Light rain sho…│               Mist           │
│      .--.     62 °F          │   ,\_(   ).   69 °F          │   ,\_(   ).   69 – 71 °F     │  _ - _ - _ -  51 °F          │
│   .-(    ).   ↙ 3 – 5 mph    │    /(___(__)  ← 5 – 6 mph    │    /(___(__)  ↖ 8 – 11 mph   │   _ - _ - _   ↖ 6 – 9 mph    │
│  (___.__)__)  6 mi           │      ‘ ‘ ‘ ‘  6 mi           │      ‘ ‘ ‘ ‘  6 mi           │  _ - _ - _ -  1 mi           │
│               0.0 in | 11%   │     ‘ ‘ ‘ ‘   0.0 in | 7%    │     ‘ ‘ ‘ ‘   0.0 in | 55%   │               0.0 in | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Fri 13. May ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│               Mist           │      .-.      Moderate or he…│               Overcast       │     \   /     Clear          │
│  _ - _ - _ -  64 °F          │     (   ).    69 – 71 °F     │      .--.     73 – 75 °F     │      .-.      64 – 66 °F     │
│   _ - _ - _   ↖ 4 – 7 mph    │    (___(__)   ↗ 10 – 13 mph  │   .-(    ).   → 9 – 17 mph   │   ― (   ) ―   → 5 – 6 mph    │
│  _ - _ - _ -  1 mi           │   ‚‘⚡‘‚⚡‚‘    6 mi           │  (___.__)__)  6 mi           │      `-’      6 mi           │
│               0.0 in | 1%    │   ‚’‚’⚡’‚’    0.0 in | 100%  │               0.0 in | 5%    │     /   \     0.0 in | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘

Check new Feature: wttr.in/Moon or wttr.in/Moon@2016-Mar-23 to see the phase of the Moon
Follow @igor_chubin for wttr.in updates

No comments: