This file contains hidden or 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
#include "node.h" | |
void Node::swap(Node &other) { | |
int tempnum = data; | |
data = other.data; | |
other.data = tempnum; | |
Node *tempnext = next; | |
next = other.next; | |
other.next = tempnext; |
This file contains hidden or 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
<script src="d3.js"></script> //Not included in Gist | |
<script type="text/javascript" src="jquery.js"></script> | |
<script src="graph.js"></script> | |
<body> | |
<svg class='chart'></svg> | |
</body> |
This file contains hidden or 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
define('BASIC_AUTH', TRUE); | |
define('CMD_LINE_OK', TRUE); | |
require_once('KML.class.php'); //Should be online | |
$kml = new KML('File'); | |
$document = new KML('Document'); | |
$document->name = 'name'; | |
$document->open = 1; |
This file contains hidden or 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 page = require('webpage').create(); | |
var args = require('system').args; | |
page.onNavigationRequested = function(url, type, willNavigate, main) { | |
console.log('Trying to navigate to: ' + url); | |
console.log('Caused by: ' + type); | |
console.log('Will actually navigate: ' + willNavigate); | |
console.log('Sent from the page\'s main frame: ' + main); | |
} |
This file contains hidden or 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
// From phantomjs | |
function waitFor(testFx, onReady, timeOutMillis) { | |
var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 300000, // maxtimeout is 3m afaik | |
start = new Date().getTime(), | |
condition = false, | |
interval = setInterval(function() { | |
if ( (new Date().getTime() - start < maxtimeOutMillis) && !condition ) { | |
// If not time-out yet and condition not yet fulfilled | |
condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()); //< defensive code, reruns testFx to see if its good now |