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 timer(callback, timeOut) { | |
var store, timeStarted; // Use store for holding data to allow clearTimeout | |
var remaining = timeOut; | |
this.start = function() { | |
timeStarted = new Date(); | |
store = setTimeout(callback, remaining); | |
} | |
this.pause = 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
<?php | |
$db_host = ''; | |
$db_username = ''; | |
$db_pass = ''; | |
$db_name = ''; | |
@mysql_connect("$db_host","$db_username","$db_pass") or die ("Could not connect to mysql"); | |
@mysql_select_db("$db_name") or die ("Database not found"); | |
?> |
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
.centeredImg { | |
display: block; | |
position: relative; | |
padding: 0px; | |
margin: 0px auto auto auto; | |
} |
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 toggle(id, callbackOn, callbackOff) { | |
if($('#' + id).data("toggledOn")) { // Turn off | |
$('#' + id).data("toggledOn",false); | |
callbackOff(); | |
} else { // Turn on | |
$('#' + id).data("toggledOn",true); | |
callbackOn(); | |
} | |
} |
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 toggle() { | |
if($('#toggleElement').data("toggledOn")) { // Turn off | |
$('#toggleElement').data("toggledOn",false); | |
/* Do something */ | |
} else { // Turn on | |
$('#toggleElement').data("toggledOn",true); | |
/* Do something */ | |
} | |
} |
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
<div id="overlay"> | |
<div id="messageBox"></div> | |
</div> | |
<script type="text/javascript"> | |
function popUp(message) { | |
document.getElementById("overlay").style.visibility = "visible"; | |
} | |
function closePopUp() { |
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 | |
$headers = 'From: ' . "\r\n"; | |
$to = ""; | |
$subject = ""; | |
$body = ""; | |
mail($to, $subject, $body, $headers); | |
?> |
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
// constants ------------------------------------------------------------------- | |
var alliedTypes = { | |
peasant: 'peasant', | |
soldier: 'soldier', | |
knight: 'knight', | |
librarian: 'librarian', | |
griffinRider: 'griffin-rider', | |
captain: 'captain' | |
}; |
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 positioning of rectangles by using a 2D array with a one-one mapping to the environmenet where a 1 indicates a | |
// potential mappable square and a 0 represents an unmappable square. Squares are 4mx4m | |
// Find rectangles by sweeping up then right to find the max possible rectangle for each section | |
// Adam Hartwell 2014, Idea shamelessly taken from post of the best algorithms for this challenge | |
var tileSize = 4; | |
var grid = this.getNavGrid().grid; | |
var gridArr = []; | |
var row, counter, x, y; | |
// Create an array with grid size 4m and each square being 1 to indicate free and 0 otherwise |
OlderNewer