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
function lastElement(array) { | |
if (array.length > 0) | |
return array[array.length - 1]; | |
else | |
return null; | |
} | |
show(lastElement([1, 2, null])); |
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
response_handler = (response)=> | |
buf = null | |
ptr = 0 | |
response.on "data", (chunk) => | |
if not buf | |
if response.headers['content-length'] | |
buf = new Buffer(parseInt(response.headers['content-length'],10)+2) | |
else | |
buf = '' |
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
function secondsFromTime(string){ | |
var split = string.split(":") | |
var seconds = parseInt(split.pop()) | |
if (seconds !== NaN) { | |
var minutes = parseInt(split.pop()) | |
if (minutes !== NaN) { | |
var hours = parseInt(split.pop()) | |
if (hours !== NaN) { | |
return hours * 60 * 60 + minutes * 60 + seconds |
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
// JavaScript Document | |
function Temp() { | |
var test = "testing"; | |
} | |
Temp.prototype.init = function() { | |
test = this.test; | |
$.ajax({ //IE errors here. | |
url: "xd_subnav.xml", | |
dataType: "xml", |
NewerOlder