This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* jshint -W097 */ | |
/* global prompt, alert */ | |
"use strict"; | |
var guess, | |
loc1 = Math.floor(Math.random() * 5), | |
loc2 = loc1 + 1, | |
loc3 = loc1 + 2, | |
hits = 0, | |
isSunk = false, | |
guesses = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Randomly scrambles the given username. | |
* @param {String} realName The username to be scrambled. | |
* @returns {String} The scrambled username. | |
*/ | |
function scrambleName(realName) { | |
"use strict"; | |
var newName = "", | |
usedChar = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Randomly scrambles the given username. | |
* https://gist.github.com/le717/4c2188ca814f56575a26. | |
* @param {String} realName The username to be scrambled. | |
* @returns {String} The scrambled username. | |
*/ | |
function scrambleName(realName) { | |
"use strict"; | |
var newName = "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Rabbit() { | |
this.color = "white"; | |
this.children = []; | |
} | |
Rabbit.prototype.pullFromHat = function() { | |
return !!Math.floor(Math.random() * 2); | |
}; | |
Rabbit.prototype.haveChildren = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SOPOMessages: | |
def __init__(self): | |
self.__encodeLegend = {} | |
self.__decodeLegend = {} | |
# Only decode the legends once per instance | |
# We only need to check if the encoding legend is generated | |
# for both legends are generated at the same time | |
if len(self.__encodeLegend) == 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def circle_info(Peri, Area): | |
if select == "Area": | |
area_of_circle(rad) | |
elif select == "Peri": | |
peri_of_circle(rad) | |
else: | |
print("Sorry, invalid selection.") | |
def area_of_circle(rad): | |
return (3.14 * (rad ** 2)) | |
def peri_of_circle(rad): |
OlderNewer