Skip to content

Instantly share code, notes, and snippets.

@katyo
katyo / Makefile
Last active August 18, 2021 21:04
Excellon Specification
all: excellon.html excellon.pdf
excellon.html: excellon.md
@pandoc $< -o $@
excellon.pdf.md: excellon.md
@cat $< | sed 's/\.png/\.pdf/g' > $@
excellon.pdf: excellon.pdf.md
@pandoc $< --latex-engine=pdflatex -o $@
@IamSilviu
IamSilviu / Get week number
Last active January 24, 2022 08:40
JavaScript Get week number.
Date.prototype.getWeek = function () {
var onejan = new Date(this.getFullYear(), 0, 1);
return Math.ceil((((this - onejan) / 86400000) + onejan.getDay() + 1) / 7);
};
var myDate = new Date("2001-02-02");
myDate.getWeek(); //=> 5