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 find(object, search, cache, path) { | |
if (!cache) | |
cache = []; | |
if (!path) | |
path = ''; | |
if (cache.indexOf(object) >= 0) | |
return; | |
cache.push(object); | |
for (var key in object) { |
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 RTCPeerConnection = window.mozRTCPeerConnection || window.webkitRTCPeerConnection || window.RTCPeerConnection; | |
var RTCSessionDescription = window.mozRTCSessionDescription || window.webkitRTCSessionDescription || window.RTCSessionDescription; | |
var RTCIceCandidate = window.mozRTCIceCandidate || window.webkitRTCIceCandidate || window.RTCIceCandidate; | |
var RTC_CONFIGURATION = {"iceServers": [{"url": "stun:stun.l.google.com:19302"}]}; | |
var MEDIA_CONSTRAINTS = {optional: [{internalSctpDataChannels: true},{DtlsSrtpKeyAgreement: true}]}; | |
function errorCallback(error) { | |
console.log(error); | |
} |
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
import org.joda.time.LocalDate; | |
import org.joda.time.Years; | |
public class DateTest { | |
public static void main(String[] args) { | |
LocalDate start = LocalDate.parse("2012-01-28"); // leap year | |
LocalDate end = LocalDate.parse("2013-01-27"); | |
LocalDate end2 = LocalDate.parse("2013-01-28"); | |
System.out.println(end.isBefore(start.plus(Years.ONE))); // true | |
System.out.println(end2.isBefore(start.plus(Years.ONE))); // false |
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
<script> | |
window.onbeforeunload = function() { | |
return "confirm"; | |
} | |
var i = 0; | |
setInterval(function() { | |
document.getElementById('display').innerHTML = i++; | |
}, 100); |
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
type | max | avg | |
---|---|---|---|
native | 116 | 16 | |
native | 109 | 19 | |
native | 123 | 17 | |
native | 194 | 16 | |
native | 125 | 19 | |
native | 118 | 17 | |
native | 141 | 17 | |
native | 126 | 17 | |
native | 132 | 16 |
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
interval | cycles | total time | median latency | median runtime | 99% percentile latency | 99% percentile runtime | 99.9% percentile latency | 99.9% percentile runtime | maximum latency | maximum runtime | |
---|---|---|---|---|---|---|---|---|---|---|---|
500000 | 20000 | 00:00:10 | 8005 | 937 | 21275 | 2343 | 31436 | 28750 | 41410 | 51509 | |
500000 | 40000 | 00:00:20 | 15080 | 1770 | 17790 | 1979 | 24525 | 2500 | 37257 | 3542 | |
500000 | 80000 | 00:00:40 | 15175 | 1719 | 18188 | 2031 | 24735 | 2760 | 46518 | 5364 | |
500000 | 160000 | 00:01:20 | 15055 | 1770 | 17672 | 1980 | 23859 | 2500 | 46035 | 4323 | |
500000 | 320000 | 00:02:40 | 15269 | 1719 | 17935 | 2031 | 23190 | 2448 | 32124 | 4010 | |
500000 | 640000 | 00:05:20 | 15193 | 1770 | 17692 | 1979 | 20731 | 2448 | 34344 | 3958 | |
500000 | 1280000 | 00:10:40 | 15232 | 1770 | 17576 | 1979 | 22202 | 2240 | 50918 | 31146 | |
500000 | 2560000 | 00:21:20 | 15086 | 1770 | 17600 | 1979 | 19680 | 2344 | 48288 | 4167 | |
500000 | 5120000 | 00:42:40 | 15064 | 1770 | 17537 | 1979 | 19592 | 2395 | 47834 | 12864 |
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
declare module 'format-message-parse' { | |
namespace parse { | |
export type AST = Element[] | |
export type Element = string | Placeholder | |
export type Placeholder = Plural | Styled | Typed | Simple | |
export type Plural = [string, 'plural' | 'selectordinal', number, SubMessages] | |
export type Styled = [string, string, string | SubMessages] | |
export type Typed = [string, string] | |
export type Simple = [string] |
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
import { injectable } from 'inversify'; | |
import { Logger } from 'log4js'; | |
import { Socket } from 'net'; | |
import Timer = NodeJS.Timer; | |
export interface KeepaliveOptions { | |
/** | |
* The maximum time in milliseconds an unused socket will be kept alive before it will be closed | |
* | |
* This should be set to a smaller value than the server's keepalive timeout to avoid a race condition |
OlderNewer