Skip to content

Instantly share code, notes, and snippets.

View cem2ran's full-sized avatar
⚛️
~ The only constant is change ~

Cem Turan cem2ran

⚛️
~ The only constant is change ~
View GitHub Profile
@cem2ran
cem2ran / gradeAverage.js
Last active August 29, 2015 14:02
Stads Average
var lines = document.getElementsByClassName('DataSelect');
var gradeCalc = {
grades: [],
average: -1,
weightedSum: 0,
ectsSum: 0
};
for(var i = 0; i < lines.length; i++){
var children = lines[i].children;
var grade = {};
@cem2ran
cem2ran / DayOfDate.js
Last active August 29, 2015 14:01
Get the corresponding day of week for a date. Algorithm provided by Claus Tøndering - http://www.tondering.dk/claus/cal/chrweek.php#calcdow.
/*
* Given a Date, Month and Year
* Return DAY_OF_WEEK.
*
* @param {Number} [D] Date in the following format: d
* @param {Number} [M] Month in the following format: m
* @param {Number} [Y] Year in the following format: yyyy
* @param {Boolean} [J=false] Defaults to the Gregorian calendar, when J is omitted or set to false. When set to true, the Day Of Week in the Julian calendar is returned.
* @return {String} The Day of Week, UPPERCASED.
*/