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
// Hacked together from http://utahjs.com/2010/09/22/nodejs-and-mysql-introduction/ | |
// Colin Faulkingham | |
// This example shows how to setup up a web server on port 8000 | |
// and fetch 10 results from a mysql database and outputting those results to HTML | |
// | |
// Version 2.0 | |
// I cleaned up the code to be more readable. |
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
# Colin Faulkingham 10/5/2010 | |
# Below is the replacement code fixes a XSS vulnerability with Apache Server errors using CGI::Application::Plus | |
; sub _run_runmode # __STEP must be 2 or 3 to run this | |
{ my ($s, $RM, @args) = @_ | |
; $s->__STEP < 2 && croak qq(Too early to call this method) | |
; $s->__STEP > 3 && croak qq(Too late to call this method) | |
; defined $RM && length $RM || croak qq(No run mode passed) | |
; $s->runmode = $RM # switch RM allowed just from here | |
; my $rm = $s->run_modes |
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 expandCollapse(id){ | |
var imgId = 'img_'+ id; | |
if(document.getElementById(id).className == 'hide'){ | |
document.getElementById(id).className='show'; | |
// This will allow the window to scroll to the expanded text | |
// | |
window.location.href = "#"+id; | |
document.getElementById(imgId).src='http://scripting.com/mktree/minus.gif'; | |
} | |
else{ |
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 httpRequest = new XMLHttpRequest(); | |
httpRequest.open('GET',url,true); | |
httpRequest.setRequestHeader("Method", "GET " + url + " HTTP/1.1"); | |
httpRequest.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); | |
httpRequest.send(null); | |
// Register the callback to parseGetLength() when the request is done. | |
httpRequest.onreadystatechange = 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
// Original xmlhttpRequest using the Greasemonkey object. | |
// | |
GM_xmlhttpRequest({ | |
'method': 'GET', | |
'url': url, | |
'onload': function (xhr) { | |
parseGetLength(queueIdx, xhr.responseText); | |
} | |
}); |
NewerOlder