Skip to content

Instantly share code, notes, and snippets.

@le717
le717 / badcountdown.js
Last active August 29, 2015 14:03
For Adventures in Website Design && Development – 6/26/14 (http://wp.me/p1V5ge-1zi)
function countDown() {
var today = new Date()
var dayOfWeek = today.toLocaleString()
dayLocate = dayOfWeek.indexOf(" ")
weekDay = dayOfWeek.substring(0, dayLocate)
newDay = dayOfWeek.substring(dayLocate)
dateLocate = newDay.indexOf(",")
monthDate = newDay.substring(0, dateLocate+1)
yearLocate = dayOfWeek.indexOf("2014")
year = dayOfWeek.substr(yearLocate, 4)
@le717
le717 / goodcountdown.js
Last active August 29, 2015 14:03
For Adventures in Website Design && Development – 6/26/14 (http://wp.me/p1V5ge-1zi)
function countDown() {
"use strict";
var curDate = new Date(),
curYear = curDate.getUTCFullYear();
var futureYear = curYear + 1,
futureMonth = 1, // UTC month value is zero-based
futureDay = 12;
// Format the date in a more readable form
@le717
le717 / age-calc.js
Last active August 29, 2015 14:00
From my tutorial "JS - Calculate your age" (http://wp.me/p1V5ge-1tM)
/* Calculate your age
* Created 2014-2015 Caleb Ely
* <http://CodeTriangle.me/>
* <https://wp.me/p1V5ge-1tM>
*/
/**
* Calculate and display the year difference between two dates.
* @param {Object.<number>} date The starting date to calculate from.
@le717
le717 / checkacronym.js
Last active December 30, 2015 01:48
Match an acronym with it's full game name.
/*
Created 2013 Triangle717
<http://Triangle717.WordPress.com/>
Please contact me at the address above if
you use this script in any of your work. :)
*/
// Object containing the game names and acronyms