Skip to content

Instantly share code, notes, and snippets.

View mmaha's full-sized avatar

M Maha mmaha

  • Canada
View GitHub Profile
@mmaha
mmaha / display-calendar.sh
Created September 4, 2011 12:39
Display calendar with current date colored
#!/bin/sh
cal | GREP_COLOR="32" grep --color -C6 -E "(^| )$(date +%e)"
@mmaha
mmaha / cal-next-month.sh
Created September 4, 2011 12:37
Display calendar for next month
#!/bin/sh
cal $(date -v +1m "+%m %Y")
@mmaha
mmaha / locate_most_filetypes.sh
Created February 2, 2011 15:55
Does a locate on specified filetypes;
#!/usr/bin/env sh
# Might need to adjust awk $3 $4 according to OS
# Add $5 and so on to get more granularity
# This one is for Mac OSX
# *Test* it out with various files. YMMV.
locate "$1" | awk -F/ '{gsub($NF,""); print $3 "/" $4}' \
| sort | uniq -c