Skip to content

Instantly share code, notes, and snippets.

@fmap
Last active January 2, 2016 11:09
Show Gist options
  • Save fmap/8294538 to your computer and use it in GitHub Desktop.
Save fmap/8294538 to your computer and use it in GitHub Desktop.
DATE="$1"
yymmdd() {
date -d"$DATE" '+%Y%m%d'
};
cat <<EOF | sed 's/^ *//'
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Hack and Tell//NONSGML v1.0//EN
BEGIN:VEVENT
UID: $(date +%s%N)@sg.hackandtell.org
SUMMARY: Hack and Tell
LOCATION: Hackerspace.SG, 344B King George's Avenue
DESCRIPTION: Show and tell for hackers. Five minute demos, each followed by five minutes of questions.
DTSTART;TZID=Asia/Singapore: $(yymmdd)T200000
DTEND;TZID=Asia/Singapore: $(yymmdd)T220000
END:VEVENT
END:VCALENDAR
EOF
@fmap
Copy link
Author

fmap commented Jan 7, 2014

% curl -s https://gist.github.com/fmap/8294538/raw/a27c9e76cffd26d6e03618100551197a008e40e3/gistfile1.sh | sh -s '20140128' > ht.ics
% ./icaltest ht.ics
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Hack and Tell//NONSGML v1.0//EN
BEGIN:VEVENT
UID: 1389074470032262971
SUMMARY: Hack and Tell
LOCATION: Hackerspace.SG, 344B King George's Avenue
DESCRIPTION: Show and tell for hackers. Five minute demos, each followed
 by five minutes of questions.
DTSTART;TZID=Asia/Singapore: 20140128T200000
DTEND;TZID=Asia/Singapore: 20140128T220000
END:VEVENT
END:VCALENDAR
% echo $?
0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment