Skip to content

Instantly share code, notes, and snippets.

View 4kills's full-sized avatar

Dominik Ochs 4kills

  • SAP SE
  • Karlsruhe, Germany
View GitHub Profile
@4kills
4kills / birthdays.js
Last active October 13, 2020 07:22
Creates an ics birthday calendar from a space separated text file (bdays_src.txt [same dir]) formatted like: [first name] [last name] [DD.MM.YYYY][os.EOL]
const fs = require('fs')
const os = require('os')
const dateToIcsString = date => "" + date.getFullYear() + (date.getMonth()+1).toString().padStart(2, '0') + date.getDate().toString().padStart(2,'0');
var f
try {
f = fs.readFileSync('bdays_src.txt', 'utf8')
} catch (err) {
console.error(err)