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
$(document).ready(function () { | |
function sol(today,limit){ | |
let incorrectStyle = 0; | |
$("tr").each(function (key, val) { | |
let $tds = $(this).find('td'), | |
$rowStyle = $(this).css('background-color'), | |
customerId = $tds.eq(0).text(), | |
issueDate = new Date($tds.eq(1).text()), | |
returnDate = $tds.eq(2).text?new Date($tds.eq(2).text()):new Date(); |
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 a(){ | |
var d1=$.Deferred(); | |
_.defer(function(){ | |
console.log("a executed"); | |
d1.resolve("resolved"); | |
//d1.reject("reject"); | |
},500); | |
d1.pipe(function successPipe(){ | |
console.log("local pipe"); |
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
$('#ta').on('keydown',function(){ | |
var thisInput = event.target; | |
var $thisInput = $(thisInput); | |
var previousScrollHeight = $thisInput.data('previous-scroll-height'); | |
if(previousScrollHeight === null || previousScrollHeight === undefined){ //first time | |
$thisInput.data('previous-scroll-height',thisInput.scrollHeight); | |
previousScrollHeight = thisInput.scrollHeight; | |
} |
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 UrlParser = function() { | |
this.result = {}; | |
}; | |
UrlParser.prototype.parse = function(url) { | |
var urlWithoutScheme = url.split('://')[1]; | |
var pathStartIndex = urlWithoutScheme.indexOf('/'); | |
var queryStartIndex = urlWithoutScheme.indexOf('?'); | |
var hostAndPort; |
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
/* | |
* Our application servers receive approximately 20 000 | |
* http requests per second. Response timeout is 19000ms. | |
* Implement a statistics collector that calculates the | |
* median and average request response times for a 7 day | |
* dataset. | |
*/ | |
'use strict'; |
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 fibo=function(n){ | |
var resp=[],previous=0, current=1; | |
while(current<n){ | |
var currentCopy=current; | |
console.log(current); | |
current= previous + current; | |
previous=currentCopy; | |
} | |
} |
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
/** | |
* @author Hadaytullah Kundi | |
*/ | |
/** | |
* Link Station as ECMAScript 2015 class. | |
*/ | |
class LinkStation { | |
/* | |
* LinkStation Constuctor |
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
<? php | |
class MorseNode { | |
private $value; | |
private $leftNode; | |
private $rightNode; | |
function __construct($value, $leftNode, $rightNode){ | |
$this->value = $value; | |
$this->leftNode = $leftNode; | |
$this->rightNode = $rightNode; |
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
<? php | |
class User { | |
private $name; | |
private $lastLoggedInAt; | |
private $loggedIn; | |
function __construct($name) { | |
$this->name = $name; | |
$this->loggedIn = false; |
NewerOlder