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
var integerBetween = function(x, y) { | |
if ( typeof x !== "number" || typeof y !== "number") { | |
console.log('integerBetween cannot accept NaN values'); | |
return false; | |
} | |
else { | |
var lowerBound = Math.floor(x); | |
var upperBound = Math.floor(y); | |
return Math.floor(Math.random() * (upperBound - lowerBound + 1) + lowerBound); | |
}; |
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
// | |
//taken verbatim from jQuery Fundamentals | |
//which is at http://jqfundamentals.com/ (see chap. 8) | |
//and has an unmaintained github repo at https://github.com/rmurphey/jqfundamentals | |
// | |
// create closure | |
// | |
(function($) { | |
// | |
// plugin definition |
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
/* puts a gray overlay over the entire page | |
just turn on display when dialog pops up */ | |
.modal-overlay { | |
display: none; | |
position: absolute; | |
top: 0; right: 0; bottom: 0; left: 0; | |
background-color: rgba(0,0,0,0.35); | |
} |
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
if (typeof String.prototype.trim !== 'function') { | |
String.prototype.trim = function() { | |
return this.replace( | |
/^\s*(\S*(?:\s+\S+)*)\s*$/, | |
"$1"); | |
}; | |
} |
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
<style> | |
#dagger { | |
/* important to have a serif font for the dagger | |
sans-serif will look like a cross | |
see: http://en.wikipedia.org/wiki/File:Daggers.svg */ | |
font-family: "Old English Text MT", "Times New Roman", Times; | |
-moz-transform: rotate(180deg); | |
-webkit-transform: rotate(180deg); | |
-o-transform: rotate(180deg); | |
-ms-transform: rotate(180deg); |
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
<?php | |
function is_on_campus($IP = false) { | |
// If no IP is passed grab it from $_SERVER[] | |
$IP = $IP ? $IP : $_SERVER['REMOTE_ADDR']; | |
// Convert IP to long integer | |
$IPnum = ip2long($IP); |
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
.clearfix:before, | |
.clearfix:after { | |
content: ""; | |
display: table; | |
} | |
.clearfix:after { | |
clear: both; | |
} | |
.clearfix { | |
*zoom: 1; |
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
// debugging technique | |
// via: http://www.learncomputer.com/javascript-tricks-you-may-not-know/ | |
function AssertException( msg ) { | |
this.msg = msg; | |
} | |
AssertException.prototype.toString = function() { | |
return 'AssertException: ' + this.msg; | |
} |